]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net-next: vmxnet3 fixes [2/5] Interrupt control bitmap
authorRonghua Zang <ronghua@vmware.com>
Fri, 16 Jul 2010 05:18:47 +0000 (22:18 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jul 2010 05:18:47 +0000 (22:18 -0700)
A new bit map 'intrCtrl' is introduced in the DriverShared area. The
driver should update VMXNET3_IC_DISABLE_ALL bit before writing IMR.

Signed-off-by: Ronghua Zang <ronghua@vmware.com>
Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vmxnet3/vmxnet3_defs.h
drivers/net/vmxnet3/vmxnet3_drv.c

index b4889e6c4a577d4ca323e68e743d321aee7979ab..ca7727b940adfd62c58bb01c32737a9c88dedcc0 100644 (file)
@@ -464,6 +464,9 @@ enum vmxnet3_intr_type {
 /* addition 1 for events */
 #define VMXNET3_MAX_INTRS      25
 
+/* value of intrCtrl */
+#define VMXNET3_IC_DISABLE_ALL  0x1   /* bit 0 */
+
 
 struct Vmxnet3_IntrConf {
        bool            autoMask;
@@ -471,7 +474,8 @@ struct Vmxnet3_IntrConf {
        u8              eventIntrIdx;
        u8              modLevels[VMXNET3_MAX_INTRS];   /* moderation level for
                                                         * each intr */
-       __le32          reserved[3];
+       __le32          intrCtrl;
+       __le32          reserved[2];
 };
 
 /* one bit per VLAN ID, the size is in the units of u32        */
index 989b742551ac4e44a2c6775c7c65cb1a796d3ba5..0fbfc67e0f79b55798809c2abc8ecf6447800ea1 100644 (file)
@@ -72,6 +72,8 @@ vmxnet3_enable_all_intrs(struct vmxnet3_adapter *adapter)
 
        for (i = 0; i < adapter->intr.num_intrs; i++)
                vmxnet3_enable_intr(adapter, i);
+       adapter->shared->devRead.intrConf.intrCtrl &=
+                                       cpu_to_le32(~VMXNET3_IC_DISABLE_ALL);
 }
 
 
@@ -80,6 +82,8 @@ vmxnet3_disable_all_intrs(struct vmxnet3_adapter *adapter)
 {
        int i;
 
+       adapter->shared->devRead.intrConf.intrCtrl |=
+                                       cpu_to_le32(VMXNET3_IC_DISABLE_ALL);
        for (i = 0; i < adapter->intr.num_intrs; i++)
                vmxnet3_disable_intr(adapter, i);
 }
@@ -1825,6 +1829,7 @@ vmxnet3_setup_driver_shared(struct vmxnet3_adapter *adapter)
                devRead->intrConf.modLevels[i] = adapter->intr.mod_levels[i];
 
        devRead->intrConf.eventIntrIdx = adapter->intr.event_intr_idx;
+       devRead->intrConf.intrCtrl |= cpu_to_le32(VMXNET3_IC_DISABLE_ALL);
 
        /* rx filter settings */
        devRead->rxFilterConf.rxMode = 0;