aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2x.h')
-rw-r--r--drivers/net/bnx2x.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h
index fd705d1295a7..15a5cf0f676b 100644
--- a/drivers/net/bnx2x.h
+++ b/drivers/net/bnx2x.h
@@ -1,6 +1,6 @@
1/* bnx2x.h: Broadcom Everest network driver. 1/* bnx2x.h: Broadcom Everest network driver.
2 * 2 *
3 * Copyright (c) 2007-2008 Broadcom Corporation 3 * Copyright (c) 2007-2009 Broadcom Corporation
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -20,6 +20,11 @@
20 * (you will need to reboot afterwards) */ 20 * (you will need to reboot afterwards) */
21/* #define BNX2X_STOP_ON_ERROR */ 21/* #define BNX2X_STOP_ON_ERROR */
22 22
23#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
24#define BCM_VLAN 1
25#endif
26
27
23/* error/debug prints */ 28/* error/debug prints */
24 29
25#define DRV_MODULE_NAME "bnx2x" 30#define DRV_MODULE_NAME "bnx2x"
@@ -78,11 +83,6 @@
78#endif 83#endif
79 84
80 85
81#ifdef NETIF_F_HW_VLAN_TX
82#define BCM_VLAN 1
83#endif
84
85
86#define U64_LO(x) (u32)(((u64)(x)) & 0xffffffff) 86#define U64_LO(x) (u32)(((u64)(x)) & 0xffffffff)
87#define U64_HI(x) (u32)(((u64)(x)) >> 32) 87#define U64_HI(x) (u32)(((u64)(x)) >> 32)
88#define HILO_U64(hi, lo) ((((u64)(hi)) << 32) + (lo)) 88#define HILO_U64(hi, lo) ((((u64)(hi)) << 32) + (lo))
@@ -150,6 +150,9 @@ struct sw_rx_page {
150 150
151#define PAGES_PER_SGE_SHIFT 0 151#define PAGES_PER_SGE_SHIFT 0
152#define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) 152#define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT)
153#define SGE_PAGE_SIZE PAGE_SIZE
154#define SGE_PAGE_SHIFT PAGE_SHIFT
155#define SGE_PAGE_ALIGN(addr) PAGE_ALIGN(addr)
153 156
154#define BCM_RX_ETH_PAYLOAD_ALIGN 64 157#define BCM_RX_ETH_PAYLOAD_ALIGN 64
155 158
@@ -268,14 +271,7 @@ struct bnx2x_fastpath {
268 271
269#define bnx2x_fp(bp, nr, var) (bp->fp[nr].var) 272#define bnx2x_fp(bp, nr, var) (bp->fp[nr].var)
270 273
271#define BNX2X_HAS_TX_WORK(fp) \ 274#define BNX2X_HAS_WORK(fp) (bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))
272 ((fp->tx_pkt_prod != le16_to_cpu(*fp->tx_cons_sb)) || \
273 (fp->tx_pkt_prod != fp->tx_pkt_cons))
274
275#define BNX2X_HAS_RX_WORK(fp) \
276 (fp->rx_comp_cons != rx_cons_sb)
277
278#define BNX2X_HAS_WORK(fp) (BNX2X_HAS_RX_WORK(fp) || BNX2X_HAS_TX_WORK(fp))
279 275
280 276
281/* MC hsi */ 277/* MC hsi */
@@ -736,7 +732,7 @@ struct bnx2x {
736 struct bnx2x_fastpath fp[MAX_CONTEXT]; 732 struct bnx2x_fastpath fp[MAX_CONTEXT];
737 void __iomem *regview; 733 void __iomem *regview;
738 void __iomem *doorbells; 734 void __iomem *doorbells;
739#define BNX2X_DB_SIZE (16*2048) 735#define BNX2X_DB_SIZE (16*BCM_PAGE_SIZE)
740 736
741 struct net_device *dev; 737 struct net_device *dev;
742 struct pci_dev *pdev; 738 struct pci_dev *pdev;
@@ -801,6 +797,8 @@ struct bnx2x {
801#define TPA_ENABLE_FLAG 0x80 797#define TPA_ENABLE_FLAG 0x80
802#define NO_MCP_FLAG 0x100 798#define NO_MCP_FLAG 0x100
803#define BP_NOMCP(bp) (bp->flags & NO_MCP_FLAG) 799#define BP_NOMCP(bp) (bp->flags & NO_MCP_FLAG)
800#define HW_VLAN_TX_FLAG 0x400
801#define HW_VLAN_RX_FLAG 0x800
804 802
805 int func; 803 int func;
806#define BP_PORT(bp) (bp->func % PORT_MAX) 804#define BP_PORT(bp) (bp->func % PORT_MAX)
@@ -811,7 +809,7 @@ struct bnx2x {
811 int pm_cap; 809 int pm_cap;
812 int pcie_cap; 810 int pcie_cap;
813 811
814 struct work_struct sp_task; 812 struct delayed_work sp_task;
815 struct work_struct reset_task; 813 struct work_struct reset_task;
816 814
817 struct timer_list timer; 815 struct timer_list timer;