Module Name: src Committed By: msaitoh Date: Fri Aug 14 06:05:40 UTC 2015
Modified Files: src/sys/dev/pci/ixgbe: ixv.c Log Message: - Fix uninitialized data. - include vlan.h and check NVLAN. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.12 src/sys/dev/pci/ixgbe/ixv.c:1.13 --- src/sys/dev/pci/ixgbe/ixv.c:1.12 Thu Aug 13 10:03:38 2015 +++ src/sys/dev/pci/ixgbe/ixv.c Fri Aug 14 06:05:40 2015 @@ -31,12 +31,13 @@ ******************************************************************************/ /*$FreeBSD: head/sys/dev/ixgbe/ixv.c 275358 2014-12-01 11:45:24Z hselasky $*/ -/*$NetBSD: ixv.c,v 1.12 2015/08/13 10:03:38 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.13 2015/08/14 06:05:40 msaitoh Exp $*/ #include "opt_inet.h" #include "opt_inet6.h" #include "ixv.h" +#include "vlan.h" /********************************************************************* * Driver version @@ -366,6 +367,10 @@ ixv_attach(device_t parent, device_t dev adapter = device_private(dev); adapter->dev = adapter->osdep.dev = dev; hw = &adapter->hw; + adapter->osdep.pc = pa->pa_pc; + adapter->osdep.tag = pa->pa_tag; + adapter->osdep.dmat = pa->pa_dmat; + adapter->osdep.attached = false; ent = ixv_lookup(pa); @@ -469,6 +474,7 @@ ixv_attach(device_t parent, device_t dev #endif INIT_DEBUGOUT("ixv_attach: end"); + adapter->osdep.attached = true; return; err_late: @@ -497,7 +503,10 @@ ixv_detach(device_t dev, int flags) struct ix_queue *que = adapter->queues; INIT_DEBUGOUT("ixv_detach: begin"); + if (adapter->osdep.attached == false) + return 0; +#if NVLAN > 0 /* Make sure VLANS are not using driver */ if (!VLAN_ATTACHED(&adapter->osdep.ec)) ; /* nothing to do: no VLANs */ @@ -507,6 +516,7 @@ ixv_detach(device_t dev, int flags) aprint_error_dev(dev, "VLANs in use\n"); return EBUSY; } +#endif IXV_CORE_LOCK(adapter); ixv_stop(adapter); @@ -1784,7 +1794,6 @@ ixv_setup_msix(struct adapter *adapter) device_t dev = adapter->dev; int want, msgs; - /* ** Want two vectors: one for a queue, ** plus an additional for mailbox. @@ -1794,6 +1803,7 @@ ixv_setup_msix(struct adapter *adapter) aprint_error_dev(dev,"MSIX config error\n"); return (ENXIO); } + want = MIN(msgs, IXG_MSIX_NINTR); adapter->msix_mem = (void *)1; /* XXX */ aprint_normal_dev(dev,