]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
Merge tag 'pm+acpi-3.15-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafae...
[mirror_ubuntu-hirsute-kernel.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_cmn.h
index a89a40f88c25779ded7f3e9357f765f191dbd55f..3448cc033ca55c33d4f8b002b2828d88b6185cd5 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/pci.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/irq.h>
 
 #include "bnx2x.h"
 #include "bnx2x_sriov.h"
@@ -47,31 +48,26 @@ extern int bnx2x_num_queues;
                } \
        } while (0)
 
-#define BNX2X_PCI_ALLOC(x, y, size) \
-       do { \
-               x = dma_zalloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
-               if (x == NULL) \
-                       goto alloc_mem_err; \
-               DP(NETIF_MSG_HW, "BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", \
-                  (unsigned long long)(*y), x); \
-       } while (0)
-
-#define BNX2X_PCI_FALLOC(x, y, size) \
-       do { \
-               x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
-               if (x == NULL) \
-                       goto alloc_mem_err; \
-               memset((void *)x, 0xFFFFFFFF, size); \
-               DP(NETIF_MSG_HW, "BNX2X_PCI_FALLOC: Physical %Lx Virtual %p\n",\
-                  (unsigned long long)(*y), x); \
-       } while (0)
-
-#define BNX2X_ALLOC(x, size) \
-       do { \
-               x = kzalloc(size, GFP_KERNEL); \
-               if (x == NULL) \
-                       goto alloc_mem_err; \
-       } while (0)
+#define BNX2X_PCI_ALLOC(y, size)                                       \
+({                                                                     \
+       void *x = dma_zalloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
+       if (x)                                                          \
+               DP(NETIF_MSG_HW,                                        \
+                  "BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n",        \
+                  (unsigned long long)(*y), x);                        \
+       x;                                                              \
+})
+#define BNX2X_PCI_FALLOC(y, size)                                      \
+({                                                                     \
+       void *x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
+       if (x) {                                                        \
+               memset(x, 0xff, size);                                  \
+               DP(NETIF_MSG_HW,                                        \
+                  "BNX2X_PCI_FALLOC: Physical %Lx Virtual %p\n",       \
+                  (unsigned long long)(*y), x);                        \
+       }                                                               \
+       x;                                                              \
+})
 
 /*********************** Interfaces ****************************
  *  Functions that need to be implemented by each driver version
@@ -1324,4 +1320,7 @@ void bnx2x_fill_fw_str(struct bnx2x *bp, char *buf, size_t buf_len);
 int bnx2x_drain_tx_queues(struct bnx2x *bp);
 void bnx2x_squeeze_objects(struct bnx2x *bp);
 
+void bnx2x_schedule_sp_rtnl(struct bnx2x*, enum sp_rtnl_flag,
+                           u32 verbose);
+
 #endif /* BNX2X_CMN_H */