Deleted Added
full compact
cxgb_main.c (170037) cxgb_main.c (170076)
1/**************************************************************************
2
3Copyright (c) 2007, Chelsio Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

--- 14 unchanged lines hidden (view full) ---

23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
28***************************************************************************/
29
30#include <sys/cdefs.h>
1/**************************************************************************
2
3Copyright (c) 2007, Chelsio Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

--- 14 unchanged lines hidden (view full) ---

23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
28***************************************************************************/
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_main.c 170037 2007-05-27 22:04:30Z kmacy $");
31__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_main.c 170076 2007-05-28 22:57:27Z kmacy $");
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/kernel.h>
36#include <sys/bus.h>
37#include <sys/module.h>
38#include <sys/pciio.h>
39#include <sys/conf.h>

--- 27 unchanged lines hidden (view full) ---

67#include <netinet/ip.h>
68#include <netinet/tcp.h>
69#include <netinet/udp.h>
70
71#include <dev/pci/pcireg.h>
72#include <dev/pci/pcivar.h>
73#include <dev/pci/pci_private.h>
74
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/kernel.h>
36#include <sys/bus.h>
37#include <sys/module.h>
38#include <sys/pciio.h>
39#include <sys/conf.h>

--- 27 unchanged lines hidden (view full) ---

67#include <netinet/ip.h>
68#include <netinet/tcp.h>
69#include <netinet/udp.h>
70
71#include <dev/pci/pcireg.h>
72#include <dev/pci/pcivar.h>
73#include <dev/pci/pci_private.h>
74
75#include <dev/cxgb/cxgb_osdep.h>
76#include <dev/cxgb/common/cxgb_common.h>
77#include <dev/cxgb/cxgb_ioctl.h>
78#include <dev/cxgb/cxgb_offload.h>
79#include <dev/cxgb/common/cxgb_regs.h>
80#include <dev/cxgb/common/cxgb_t3_cpl.h>
81#include <dev/cxgb/common/cxgb_firmware_exports.h>
75#ifdef CONFIG_DEFINED
76#include <cxgb_include.h>
77#else
78#include <dev/cxgb/cxgb_include.h>
79#endif
82
80
83#include <dev/cxgb/sys/mvec.h>
84
85
86#ifdef PRIV_SUPPORTED
87#include <sys/priv.h>
88#endif
89
90static int cxgb_setup_msix(adapter_t *, int);
91static void cxgb_init(void *);
92static void cxgb_init_locked(struct port_info *);
93static void cxgb_stop_locked(struct port_info *);

--- 1499 unchanged lines hidden (view full) ---

1593 m = m0;
1594 if ((err = t3_encap(p, &m)) != 0)
1595 break;
1596 BPF_MTAP(ifp, m);
1597 }
1598 mtx_unlock(&txq->lock);
1599
1600 if (__predict_false(err)) {
81#ifdef PRIV_SUPPORTED
82#include <sys/priv.h>
83#endif
84
85static int cxgb_setup_msix(adapter_t *, int);
86static void cxgb_init(void *);
87static void cxgb_init_locked(struct port_info *);
88static void cxgb_stop_locked(struct port_info *);

--- 1499 unchanged lines hidden (view full) ---

1588 m = m0;
1589 if ((err = t3_encap(p, &m)) != 0)
1590 break;
1591 BPF_MTAP(ifp, m);
1592 }
1593 mtx_unlock(&txq->lock);
1594
1595 if (__predict_false(err)) {
1601 if (cxgb_debug)
1602 printf("would set OFLAGS\n");
1603 if (err == ENOMEM) {
1604 IFQ_LOCK(&ifp->if_snd);
1605 IFQ_DRV_PREPEND(&ifp->if_snd, m);
1606 IFQ_UNLOCK(&ifp->if_snd);
1607 }
1608 }
1596 if (err == ENOMEM) {
1597 IFQ_LOCK(&ifp->if_snd);
1598 IFQ_DRV_PREPEND(&ifp->if_snd, m);
1599 IFQ_UNLOCK(&ifp->if_snd);
1600 }
1601 }
1609 if (err == 0 && m == NULL)
1610 err = ENOBUFS;
1611
1602 if (err == 0 && m == NULL) {
1603 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1604 return (ENOBUFS);
1605 }
1612 if ((err == 0) && (txq->size <= txq->in_use + TX_MAX_DESC) &&
1613 (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) {
1614 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1606 if ((err == 0) && (txq->size <= txq->in_use + TX_MAX_DESC) &&
1607 (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) {
1608 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1615 err = ENOSPC;
1609 return (ENOSPC);
1616 }
1617 return (err);
1618}
1619
1620static void
1621cxgb_start_proc(void *arg, int ncount)
1622{
1623 struct ifnet *ifp = arg;

--- 616 unchanged lines hidden ---
1610 }
1611 return (err);
1612}
1613
1614static void
1615cxgb_start_proc(void *arg, int ncount)
1616{
1617 struct ifnet *ifp = arg;

--- 616 unchanged lines hidden ---