diff --git a/sys/dev/cxgb/common/cxgb_ael1002.c b/sys/dev/cxgb/common/cxgb_ael1002.c index 02c4c2f8e0ad..3d67b0620749 100644 --- a/sys/dev/cxgb/common/cxgb_ael1002.c +++ b/sys/dev/cxgb/common/cxgb_ael1002.c @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -34,8 +30,11 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif enum { AEL100X_TX_DISABLE = 9, diff --git a/sys/dev/cxgb/common/cxgb_common.h b/sys/dev/cxgb/common/cxgb_common.h index ae73bffd7072..1a0477251ebf 100644 --- a/sys/dev/cxgb/common/cxgb_common.h +++ b/sys/dev/cxgb/common/cxgb_common.h @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -35,7 +31,11 @@ $FreeBSD$ #ifndef __CHELSIO_COMMON_H #define __CHELSIO_COMMON_H +#ifdef CONFIG_DEFINED +#include +#else #include +#endif enum { MAX_NPORTS = 2, /* max # of ports */ @@ -538,7 +538,11 @@ struct addr_val_pair { unsigned int val; }; +#ifdef CONFIG_DEFINED +#include +#else #include +#endif #ifndef PCI_VENDOR_ID_CHELSIO # define PCI_VENDOR_ID_CHELSIO 0x1425 diff --git a/sys/dev/cxgb/common/cxgb_firmware_exports.h b/sys/dev/cxgb/common/cxgb_firmware_exports.h index 99f97a824386..e361c959265d 100644 --- a/sys/dev/cxgb/common/cxgb_firmware_exports.h +++ b/sys/dev/cxgb/common/cxgb_firmware_exports.h @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/sys/dev/cxgb/common/cxgb_mc5.c b/sys/dev/cxgb/common/cxgb_mc5.c index abbf71f49497..9d3b94f888cd 100644 --- a/sys/dev/cxgb/common/cxgb_mc5.c +++ b/sys/dev/cxgb/common/cxgb_mc5.c @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -34,8 +30,11 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif enum { IDT75P52100 = 4, diff --git a/sys/dev/cxgb/common/cxgb_mv88e1xxx.c b/sys/dev/cxgb/common/cxgb_mv88e1xxx.c index 688b6e000fd9..6cee581bb501 100644 --- a/sys/dev/cxgb/common/cxgb_mv88e1xxx.c +++ b/sys/dev/cxgb/common/cxgb_mv88e1xxx.c @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -34,7 +30,11 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif /* Marvell PHY interrupt status bits. */ #define MV_INTR_JABBER 0x0001 diff --git a/sys/dev/cxgb/common/cxgb_regs.h b/sys/dev/cxgb/common/cxgb_regs.h index fe8cd1461579..63744c49191e 100644 --- a/sys/dev/cxgb/common/cxgb_regs.h +++ b/sys/dev/cxgb/common/cxgb_regs.h @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/sys/dev/cxgb/common/cxgb_sge_defs.h b/sys/dev/cxgb/common/cxgb_sge_defs.h index d421673545ea..d850103abc2a 100644 --- a/sys/dev/cxgb/common/cxgb_sge_defs.h +++ b/sys/dev/cxgb/common/cxgb_sge_defs.h @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/sys/dev/cxgb/common/cxgb_t3_cpl.h b/sys/dev/cxgb/common/cxgb_t3_cpl.h index c737b0558c54..06e99f264d74 100644 --- a/sys/dev/cxgb/common/cxgb_t3_cpl.h +++ b/sys/dev/cxgb/common/cxgb_t3_cpl.h @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/sys/dev/cxgb/common/cxgb_t3_hw.c b/sys/dev/cxgb/common/cxgb_t3_hw.c index c99008e98448..ac4a6308f3fc 100644 --- a/sys/dev/cxgb/common/cxgb_t3_hw.c +++ b/sys/dev/cxgb/common/cxgb_t3_hw.c @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -34,10 +30,11 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif /** * t3_wait_op_done_val - wait until an operation is completed diff --git a/sys/dev/cxgb/common/cxgb_tcb.h b/sys/dev/cxgb/common/cxgb_tcb.h index 82a67ea2cced..5dc72f5467fb 100644 --- a/sys/dev/cxgb/common/cxgb_tcb.h +++ b/sys/dev/cxgb/common/cxgb_tcb.h @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/sys/dev/cxgb/common/cxgb_version.h b/sys/dev/cxgb/common/cxgb_version.h index 2e48b523b3ee..88296af4a152 100644 --- a/sys/dev/cxgb/common/cxgb_version.h +++ b/sys/dev/cxgb/common/cxgb_version.h @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/sys/dev/cxgb/common/cxgb_vsc8211.c b/sys/dev/cxgb/common/cxgb_vsc8211.c index f118c02baa67..c3b3532599ed 100644 --- a/sys/dev/cxgb/common/cxgb_vsc8211.c +++ b/sys/dev/cxgb/common/cxgb_vsc8211.c @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -34,7 +30,11 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif /* VSC8211 PHY specific registers. */ enum { diff --git a/sys/dev/cxgb/common/cxgb_xgmac.c b/sys/dev/cxgb/common/cxgb_xgmac.c index 68c388e8aff1..22cd22e686c7 100644 --- a/sys/dev/cxgb/common/cxgb_xgmac.c +++ b/sys/dev/cxgb/common/cxgb_xgmac.c @@ -9,11 +9,7 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Chelsio Corporation nor the names of its + 2. Neither the name of the Chelsio Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -34,8 +30,11 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif /* * # of exact address filters. The first one is used for the station address, diff --git a/sys/dev/cxgb/cxgb_adapter.h b/sys/dev/cxgb/cxgb_adapter.h index f5c8a4c2871f..e6780034e5d2 100644 --- a/sys/dev/cxgb/cxgb_adapter.h +++ b/sys/dev/cxgb/cxgb_adapter.h @@ -55,8 +55,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif struct adapter; struct sge_qset; diff --git a/sys/dev/cxgb/cxgb_include.h b/sys/dev/cxgb/cxgb_include.h new file mode 100644 index 000000000000..c4eb5add9ffe --- /dev/null +++ b/sys/dev/cxgb/cxgb_include.h @@ -0,0 +1,37 @@ +/* + * $FreeBSD$ + */ + + +#ifdef CONFIG_DEFINED +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#endif diff --git a/sys/dev/cxgb/cxgb_l2t.c b/sys/dev/cxgb/cxgb_l2t.c index 8cc8211ce5f6..046132da85d8 100644 --- a/sys/dev/cxgb/cxgb_l2t.c +++ b/sys/dev/cxgb/cxgb_l2t.c @@ -50,14 +50,11 @@ __FBSDID("$FreeBSD$"); #include #include - -#include -#include -#include -#include -#include -#include -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif #define VLAN_NONE 0xfff #define SDL(s) ((struct sockaddr_dl *)s) diff --git a/sys/dev/cxgb/cxgb_lro.c b/sys/dev/cxgb/cxgb_lro.c index 8b24298745b4..9745cdf7cfda 100644 --- a/sys/dev/cxgb/cxgb_lro.c +++ b/sys/dev/cxgb/cxgb_lro.c @@ -49,9 +49,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include + +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif #include diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index f4a0aa8a73f7..e500f7a9a3c3 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -72,16 +72,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include -#include -#include - -#include - +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif #ifdef PRIV_SUPPORTED #include @@ -1598,21 +1593,20 @@ cxgb_start_tx(struct ifnet *ifp, uint32_t txmax) mtx_unlock(&txq->lock); if (__predict_false(err)) { - if (cxgb_debug) - printf("would set OFLAGS\n"); if (err == ENOMEM) { IFQ_LOCK(&ifp->if_snd); IFQ_DRV_PREPEND(&ifp->if_snd, m); IFQ_UNLOCK(&ifp->if_snd); } } - if (err == 0 && m == NULL) - err = ENOBUFS; - + if (err == 0 && m == NULL) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + return (ENOBUFS); + } if ((err == 0) && (txq->size <= txq->in_use + TX_MAX_DESC) && (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; - err = ENOSPC; + return (ENOSPC); } return (err); } diff --git a/sys/dev/cxgb/cxgb_offload.c b/sys/dev/cxgb/cxgb_offload.c index f3909111b21f..a6d7a9973bc1 100644 --- a/sys/dev/cxgb/cxgb_offload.c +++ b/sys/dev/cxgb/cxgb_offload.c @@ -55,14 +55,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif #include #include diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 6be25e4ad346..4bd2a91318d4 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -57,14 +57,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include -#include -#include +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif uint32_t collapse_free = 0; uint32_t mb_free_vec_free = 0; diff --git a/sys/dev/cxgb/sys/mbufq.h b/sys/dev/cxgb/sys/mbufq.h index 114ac8521670..d8de43296d63 100644 --- a/sys/dev/cxgb/sys/mbufq.h +++ b/sys/dev/cxgb/sys/mbufq.h @@ -29,6 +29,9 @@ $FreeBSD$ ***************************************************************************/ +#ifndef CXGB_MBUFQ_H_ +#define CXGB_MBUFQ_H_ + struct mbuf_head { struct mbuf *head; struct mbuf *tail; @@ -84,3 +87,5 @@ mbufq_peek(struct mbuf_head *l) { return (l->head); } + +#endif /* CXGB_MBUFQ_H_ */ diff --git a/sys/dev/cxgb/sys/uipc_mvec.c b/sys/dev/cxgb/sys/uipc_mvec.c index bcf3e24c2a70..04082727eb7c 100644 --- a/sys/dev/cxgb/sys/uipc_mvec.c +++ b/sys/dev/cxgb/sys/uipc_mvec.c @@ -41,19 +41,19 @@ __FBSDID("$FreeBSD$"); #include #include -#include + +#ifdef CONFIG_DEFINED +#include +#else +#include +#endif + #include "opt_zero.h" #include #include #include -#ifdef DEBUG -#define DPRINTF printf -#else -#define DPRINTF(...) -#endif - #ifdef INVARIANTS #define M_SANITY m_sanity #else diff --git a/sys/modules/cxgb/Makefile b/sys/modules/cxgb/Makefile index fa72d2a172e4..5df8112bfa57 100644 --- a/sys/modules/cxgb/Makefile +++ b/sys/modules/cxgb/Makefile @@ -10,7 +10,7 @@ SRCS+= cxgb_offload.c cxgb_l2t.c SRCS+= device_if.h bus_if.h pci_if.h opt_zero.h SRCS+= uipc_mvec.c -CFLAGS+= -DCONFIG_CHELSIO_T3_CORE -g -DDEFAULT_JUMBO -DCONFIG_DEFINED +CFLAGS+= -DCONFIG_CHELSIO_T3_CORE -g -DDEFAULT_JUMBO -DCONFIG_DEFINED -I${CXGB} #CFLAGS+= -DINVARIANT_SUPPORT -DINVARIANTS -DDEBUG .if ${MACHINE_ARCH} != "ia64"