aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
diff options
context:
space:
mode:
authorYuval Mintz <yuvalmin@broadcom.com>2013-01-22 22:21:43 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-23 13:58:27 -0500
commit2de67439c1f50e32fb54ca70786fcfa96c5bfd53 (patch)
treef53de0774c1a87adac71947b940f5a720376ed22 /drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
parentf5ae62799a31fb2ce8b272bf184688e2a4770d19 (diff)
bnx2x: Semantic renovation
Mostly corrects white spaces, indentations, and comments. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x.h')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x.h50
1 files changed, 21 insertions, 29 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 3e08a24890e5..9e8c37d007a4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -141,8 +141,8 @@ do { \
141#define bnx2x_mc_addr(ha) ((ha)->addr) 141#define bnx2x_mc_addr(ha) ((ha)->addr)
142#define bnx2x_uc_addr(ha) ((ha)->addr) 142#define bnx2x_uc_addr(ha) ((ha)->addr)
143 143
144#define U64_LO(x) (u32)(((u64)(x)) & 0xffffffff) 144#define U64_LO(x) ((u32)(((u64)(x)) & 0xffffffff))
145#define U64_HI(x) (u32)(((u64)(x)) >> 32) 145#define U64_HI(x) ((u32)(((u64)(x)) >> 32))
146#define HILO_U64(hi, lo) ((((u64)(hi)) << 32) + (lo)) 146#define HILO_U64(hi, lo) ((((u64)(hi)) << 32) + (lo))
147 147
148 148
@@ -812,7 +812,7 @@ struct bnx2x_common {
812#define CHIP_NUM_57811 0x163d 812#define CHIP_NUM_57811 0x163d
813#define CHIP_NUM_57811_MF 0x163e 813#define CHIP_NUM_57811_MF 0x163e
814#define CHIP_NUM_57811_VF 0x163f 814#define CHIP_NUM_57811_VF 0x163f
815#define CHIP_NUM_57840_OBSOLETE 0x168d 815#define CHIP_NUM_57840_OBSOLETE 0x168d
816#define CHIP_NUM_57840_MF_OBSOLETE 0x16ab 816#define CHIP_NUM_57840_MF_OBSOLETE 0x16ab
817#define CHIP_NUM_57840_4_10 0x16a1 817#define CHIP_NUM_57840_4_10 0x16a1
818#define CHIP_NUM_57840_2_20 0x16a2 818#define CHIP_NUM_57840_2_20 0x16a2
@@ -1195,11 +1195,11 @@ struct bnx2x_fw_stats_req {
1195}; 1195};
1196 1196
1197struct bnx2x_fw_stats_data { 1197struct bnx2x_fw_stats_data {
1198 struct stats_counter storm_counters; 1198 struct stats_counter storm_counters;
1199 struct per_port_stats port; 1199 struct per_port_stats port;
1200 struct per_pf_stats pf; 1200 struct per_pf_stats pf;
1201 struct fcoe_statistics_params fcoe; 1201 struct fcoe_statistics_params fcoe;
1202 struct per_queue_stats queue_stats[1]; 1202 struct per_queue_stats queue_stats[1];
1203}; 1203};
1204 1204
1205/* Public slow path states */ 1205/* Public slow path states */
@@ -1343,8 +1343,6 @@ struct bnx2x {
1343 __le16 *eq_cons_sb; 1343 __le16 *eq_cons_sb;
1344 atomic_t eq_spq_left; /* COMMON_XXX ramrods credit */ 1344 atomic_t eq_spq_left; /* COMMON_XXX ramrods credit */
1345 1345
1346
1347
1348 /* Counter for marking that there is a STAT_QUERY ramrod pending */ 1346 /* Counter for marking that there is a STAT_QUERY ramrod pending */
1349 u16 stats_pending; 1347 u16 stats_pending;
1350 /* Counter for completed statistics ramrods */ 1348 /* Counter for completed statistics ramrods */
@@ -2076,10 +2074,8 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
2076#define BNX2X_LOOPBACK_FAILED (BNX2X_MAC_LOOPBACK_FAILED | \ 2074#define BNX2X_LOOPBACK_FAILED (BNX2X_MAC_LOOPBACK_FAILED | \
2077 BNX2X_PHY_LOOPBACK_FAILED) 2075 BNX2X_PHY_LOOPBACK_FAILED)
2078 2076
2079
2080#define STROM_ASSERT_ARRAY_SIZE 50 2077#define STROM_ASSERT_ARRAY_SIZE 50
2081 2078
2082
2083/* must be used on a CID before placing it on a HW ring */ 2079/* must be used on a CID before placing it on a HW ring */
2084#define HW_CID(bp, x) ((BP_PORT(bp) << 23) | \ 2080#define HW_CID(bp, x) ((BP_PORT(bp) << 23) | \
2085 (BP_VN(bp) << BNX2X_SWCID_SHIFT) | \ 2081 (BP_VN(bp) << BNX2X_SWCID_SHIFT) | \
@@ -2110,7 +2106,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
2110/* Memory of fairness algorithm . 2 cycles */ 2106/* Memory of fairness algorithm . 2 cycles */
2111#define FAIR_MEM 2 2107#define FAIR_MEM 2
2112 2108
2113
2114#define ATTN_NIG_FOR_FUNC (1L << 8) 2109#define ATTN_NIG_FOR_FUNC (1L << 8)
2115#define ATTN_SW_TIMER_4_FUNC (1L << 9) 2110#define ATTN_SW_TIMER_4_FUNC (1L << 9)
2116#define GPIO_2_FUNC (1L << 10) 2111#define GPIO_2_FUNC (1L << 10)
@@ -2215,7 +2210,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
2215 2210
2216#define MULTI_MASK 0x7f 2211#define MULTI_MASK 0x7f
2217 2212
2218
2219#define DEF_USB_FUNC_OFF offsetof(struct cstorm_def_status_block_u, func) 2213#define DEF_USB_FUNC_OFF offsetof(struct cstorm_def_status_block_u, func)
2220#define DEF_CSB_FUNC_OFF offsetof(struct cstorm_def_status_block_c, func) 2214#define DEF_CSB_FUNC_OFF offsetof(struct cstorm_def_status_block_c, func)
2221#define DEF_XSB_FUNC_OFF offsetof(struct xstorm_def_status_block, func) 2215#define DEF_XSB_FUNC_OFF offsetof(struct xstorm_def_status_block, func)
@@ -2243,18 +2237,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
2243 (&bp->def_status_blk->sp_sb.\ 2237 (&bp->def_status_blk->sp_sb.\
2244 index_values[HC_SP_INDEX_ETH_DEF_CONS]) 2238 index_values[HC_SP_INDEX_ETH_DEF_CONS])
2245 2239
2246#define SET_FLAG(value, mask, flag) \
2247 do {\
2248 (value) &= ~(mask);\
2249 (value) |= ((flag) << (mask##_SHIFT));\
2250 } while (0)
2251
2252#define GET_FLAG(value, mask) \
2253 (((value) & (mask)) >> (mask##_SHIFT))
2254
2255#define GET_FIELD(value, fname) \
2256 (((value) & (fname##_MASK)) >> (fname##_SHIFT))
2257
2258#define CAM_IS_INVALID(x) \ 2240#define CAM_IS_INVALID(x) \
2259 (GET_FLAG(x.flags, \ 2241 (GET_FLAG(x.flags, \
2260 MAC_CONFIGURATION_ENTRY_ACTION_TYPE) == \ 2242 MAC_CONFIGURATION_ENTRY_ACTION_TYPE) == \
@@ -2265,7 +2247,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
2265#define MC_HASH_OFFSET(bp, i) (BAR_TSTRORM_INTMEM + \ 2247#define MC_HASH_OFFSET(bp, i) (BAR_TSTRORM_INTMEM + \
2266 TSTORM_APPROXIMATE_MATCH_MULTICAST_FILTERING_OFFSET(BP_FUNC(bp)) + i*4) 2248 TSTORM_APPROXIMATE_MATCH_MULTICAST_FILTERING_OFFSET(BP_FUNC(bp)) + i*4)
2267 2249
2268
2269#ifndef PXP2_REG_PXP2_INT_STS 2250#ifndef PXP2_REG_PXP2_INT_STS
2270#define PXP2_REG_PXP2_INT_STS PXP2_REG_PXP2_INT_STS_0 2251#define PXP2_REG_PXP2_INT_STS PXP2_REG_PXP2_INT_STS_0
2271#endif 2252#endif
@@ -2285,8 +2266,8 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
2285 (!((me_reg) & ME_REG_VF_ERR))) 2266 (!((me_reg) & ME_REG_VF_ERR)))
2286int bnx2x_nic_load_analyze_req(struct bnx2x *bp, u32 load_code); 2267int bnx2x_nic_load_analyze_req(struct bnx2x *bp, u32 load_code);
2287/* Congestion management fairness mode */ 2268/* Congestion management fairness mode */
2288#define CMNG_FNS_NONE 0 2269#define CMNG_FNS_NONE 0
2289#define CMNG_FNS_MINMAX 1 2270#define CMNG_FNS_MINMAX 1
2290 2271
2291#define HC_SEG_ACCESS_DEF 0 /*Driver decision 0-3*/ 2272#define HC_SEG_ACCESS_DEF 0 /*Driver decision 0-3*/
2292#define HC_SEG_ACCESS_ATTN 4 2273#define HC_SEG_ACCESS_ATTN 4
@@ -2302,7 +2283,6 @@ static const u32 dmae_reg_go_c[] = {
2302void bnx2x_set_ethtool_ops(struct net_device *netdev); 2283void bnx2x_set_ethtool_ops(struct net_device *netdev);
2303void bnx2x_notify_link_changed(struct bnx2x *bp); 2284void bnx2x_notify_link_changed(struct bnx2x *bp);
2304 2285
2305
2306#define BNX2X_MF_SD_PROTOCOL(bp) \ 2286#define BNX2X_MF_SD_PROTOCOL(bp) \
2307 ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK) 2287 ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK)
2308 2288
@@ -2323,6 +2303,18 @@ void bnx2x_notify_link_changed(struct bnx2x *bp);
2323 (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \ 2303 (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \
2324 BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))) 2304 BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)))
2325 2305
2306#define SET_FLAG(value, mask, flag) \
2307 do {\
2308 (value) &= ~(mask);\
2309 (value) |= ((flag) << (mask##_SHIFT));\
2310 } while (0)
2311
2312#define GET_FLAG(value, mask) \
2313 (((value) & (mask)) >> (mask##_SHIFT))
2314
2315#define GET_FIELD(value, fname) \
2316 (((value) & (fname##_MASK)) >> (fname##_SHIFT))
2317
2326enum { 2318enum {
2327 SWITCH_UPDATE, 2319 SWITCH_UPDATE,
2328 AFEX_UPDATE, 2320 AFEX_UPDATE,