Commit 8f7e524c authored by Randy Dunlap's avatar Randy Dunlap Committed by David S. Miller

vmxnet: fix 2 build problems

vmxnet3 uses in_dev* interfaces so it should depend on INET.
Also fix so that the driver builds when CONFIG_PCI_MSI is disabled.

vmxnet3_drv.c:(.text+0x2a88cb): undefined reference to `in_dev_finish_destroy'

drivers/net/vmxnet3/vmxnet3_drv.c:1335: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
drivers/net/vmxnet3/vmxnet3_drv.c:1384: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
drivers/net/vmxnet3/vmxnet3_drv.c:2137: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
drivers/net/vmxnet3/vmxnet3_drv.c:2138: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarBhavesh davda <bhavesh@vmware.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 47dd7a54
...@@ -3235,7 +3235,7 @@ config VIRTIO_NET ...@@ -3235,7 +3235,7 @@ config VIRTIO_NET
config VMXNET3 config VMXNET3
tristate "VMware VMXNET3 ethernet driver" tristate "VMware VMXNET3 ethernet driver"
depends on PCI && X86 depends on PCI && X86 && INET
help help
This driver supports VMware's vmxnet3 virtual ethernet NIC. This driver supports VMware's vmxnet3 virtual ethernet NIC.
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
......
...@@ -1314,9 +1314,11 @@ vmxnet3_netpoll(struct net_device *netdev) ...@@ -1314,9 +1314,11 @@ vmxnet3_netpoll(struct net_device *netdev)
struct vmxnet3_adapter *adapter = netdev_priv(netdev); struct vmxnet3_adapter *adapter = netdev_priv(netdev);
int irq; int irq;
#ifdef CONFIG_PCI_MSI
if (adapter->intr.type == VMXNET3_IT_MSIX) if (adapter->intr.type == VMXNET3_IT_MSIX)
irq = adapter->intr.msix_entries[0].vector; irq = adapter->intr.msix_entries[0].vector;
else else
#endif
irq = adapter->pdev->irq; irq = adapter->pdev->irq;
disable_irq(irq); disable_irq(irq);
...@@ -1330,12 +1332,15 @@ vmxnet3_request_irqs(struct vmxnet3_adapter *adapter) ...@@ -1330,12 +1332,15 @@ vmxnet3_request_irqs(struct vmxnet3_adapter *adapter)
{ {
int err; int err;
#ifdef CONFIG_PCI_MSI
if (adapter->intr.type == VMXNET3_IT_MSIX) { if (adapter->intr.type == VMXNET3_IT_MSIX) {
/* we only use 1 MSI-X vector */ /* we only use 1 MSI-X vector */
err = request_irq(adapter->intr.msix_entries[0].vector, err = request_irq(adapter->intr.msix_entries[0].vector,
vmxnet3_intr, 0, adapter->netdev->name, vmxnet3_intr, 0, adapter->netdev->name,
adapter->netdev); adapter->netdev);
} else if (adapter->intr.type == VMXNET3_IT_MSI) { } else
#endif
if (adapter->intr.type == VMXNET3_IT_MSI) {
err = request_irq(adapter->pdev->irq, vmxnet3_intr, 0, err = request_irq(adapter->pdev->irq, vmxnet3_intr, 0,
adapter->netdev->name, adapter->netdev); adapter->netdev->name, adapter->netdev);
} else { } else {
...@@ -1376,6 +1381,7 @@ vmxnet3_free_irqs(struct vmxnet3_adapter *adapter) ...@@ -1376,6 +1381,7 @@ vmxnet3_free_irqs(struct vmxnet3_adapter *adapter)
adapter->intr.num_intrs <= 0); adapter->intr.num_intrs <= 0);
switch (adapter->intr.type) { switch (adapter->intr.type) {
#ifdef CONFIG_PCI_MSI
case VMXNET3_IT_MSIX: case VMXNET3_IT_MSIX:
{ {
int i; int i;
...@@ -1385,6 +1391,7 @@ vmxnet3_free_irqs(struct vmxnet3_adapter *adapter) ...@@ -1385,6 +1391,7 @@ vmxnet3_free_irqs(struct vmxnet3_adapter *adapter)
adapter->netdev); adapter->netdev);
break; break;
} }
#endif
case VMXNET3_IT_MSI: case VMXNET3_IT_MSI:
free_irq(adapter->pdev->irq, adapter->netdev); free_irq(adapter->pdev->irq, adapter->netdev);
break; break;
...@@ -2134,6 +2141,7 @@ vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter) ...@@ -2134,6 +2141,7 @@ vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter)
if (adapter->intr.type == VMXNET3_IT_AUTO) { if (adapter->intr.type == VMXNET3_IT_AUTO) {
int err; int err;
#ifdef CONFIG_PCI_MSI
adapter->intr.msix_entries[0].entry = 0; adapter->intr.msix_entries[0].entry = 0;
err = pci_enable_msix(adapter->pdev, adapter->intr.msix_entries, err = pci_enable_msix(adapter->pdev, adapter->intr.msix_entries,
VMXNET3_LINUX_MAX_MSIX_VECT); VMXNET3_LINUX_MAX_MSIX_VECT);
...@@ -2142,6 +2150,7 @@ vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter) ...@@ -2142,6 +2150,7 @@ vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter)
adapter->intr.type = VMXNET3_IT_MSIX; adapter->intr.type = VMXNET3_IT_MSIX;
return; return;
} }
#endif
err = pci_enable_msi(adapter->pdev); err = pci_enable_msi(adapter->pdev);
if (!err) { if (!err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment