aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x
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
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')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x.h50
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c28
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h3
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c5
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c26
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h6
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c51
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c20
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h2
9 files changed, 86 insertions, 105 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,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 49810a0eaa30..96a60f012d15 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -237,7 +237,7 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata)
237 txdata->txq_index, hw_cons, sw_cons, pkt_cons); 237 txdata->txq_index, hw_cons, sw_cons, pkt_cons);
238 238
239 bd_cons = bnx2x_free_tx_pkt(bp, txdata, pkt_cons, 239 bd_cons = bnx2x_free_tx_pkt(bp, txdata, pkt_cons,
240 &pkts_compl, &bytes_compl); 240 &pkts_compl, &bytes_compl);
241 241
242 sw_cons++; 242 sw_cons++;
243 } 243 }
@@ -343,14 +343,14 @@ static inline void bnx2x_update_sge_prod(struct bnx2x_fastpath *fp,
343 fp->last_max_sge, fp->rx_sge_prod); 343 fp->last_max_sge, fp->rx_sge_prod);
344} 344}
345 345
346/* Set Toeplitz hash value in the skb using the value from the 346/* Get Toeplitz hash value in the skb using the value from the
347 * CQE (calculated by HW). 347 * CQE (calculated by HW).
348 */ 348 */
349static u32 bnx2x_get_rxhash(const struct bnx2x *bp, 349static u32 bnx2x_get_rxhash(const struct bnx2x *bp,
350 const struct eth_fast_path_rx_cqe *cqe, 350 const struct eth_fast_path_rx_cqe *cqe,
351 bool *l4_rxhash) 351 bool *l4_rxhash)
352{ 352{
353 /* Set Toeplitz hash from CQE */ 353 /* Get Toeplitz hash from CQE */
354 if ((bp->dev->features & NETIF_F_RXHASH) && 354 if ((bp->dev->features & NETIF_F_RXHASH) &&
355 (cqe->status_flags & ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG)) { 355 (cqe->status_flags & ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG)) {
356 enum eth_rss_hash_type htype; 356 enum eth_rss_hash_type htype;
@@ -449,7 +449,7 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue,
449 * 449 *
450 * Approximate value of the MSS for this aggregation calculated using 450 * Approximate value of the MSS for this aggregation calculated using
451 * the first packet of it. 451 * the first packet of it.
452 * Compute number of aggregated segments, and gso_type 452 * Compute number of aggregated segments, and gso_type.
453 */ 453 */
454static void bnx2x_set_gro_params(struct sk_buff *skb, u16 parsing_flags, 454static void bnx2x_set_gro_params(struct sk_buff *skb, u16 parsing_flags,
455 u16 len_on_bd, unsigned int pkt_len) 455 u16 len_on_bd, unsigned int pkt_len)
@@ -619,7 +619,6 @@ static void *bnx2x_frag_alloc(const struct bnx2x_fastpath *fp)
619 return kmalloc(fp->rx_buf_size + NET_SKB_PAD, GFP_ATOMIC); 619 return kmalloc(fp->rx_buf_size + NET_SKB_PAD, GFP_ATOMIC);
620} 620}
621 621
622
623#ifdef CONFIG_INET 622#ifdef CONFIG_INET
624static void bnx2x_gro_ip_csum(struct bnx2x *bp, struct sk_buff *skb) 623static void bnx2x_gro_ip_csum(struct bnx2x *bp, struct sk_buff *skb)
625{ 624{
@@ -1827,7 +1826,6 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb)
1827 return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp)); 1826 return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp));
1828} 1827}
1829 1828
1830
1831void bnx2x_set_num_queues(struct bnx2x *bp) 1829void bnx2x_set_num_queues(struct bnx2x *bp)
1832{ 1830{
1833 /* RSS queues */ 1831 /* RSS queues */
@@ -2483,7 +2481,6 @@ load_error_cnic0:
2483#endif /* ! BNX2X_STOP_ON_ERROR */ 2481#endif /* ! BNX2X_STOP_ON_ERROR */
2484} 2482}
2485 2483
2486
2487/* must be called with rtnl_lock */ 2484/* must be called with rtnl_lock */
2488int bnx2x_nic_load(struct bnx2x *bp, int load_mode) 2485int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
2489{ 2486{
@@ -3064,7 +3061,6 @@ int bnx2x_poll(struct napi_struct *napi, int budget)
3064 if (bnx2x_tx_queue_has_work(fp->txdata_ptr[cos])) 3061 if (bnx2x_tx_queue_has_work(fp->txdata_ptr[cos]))
3065 bnx2x_tx_int(bp, fp->txdata_ptr[cos]); 3062 bnx2x_tx_int(bp, fp->txdata_ptr[cos]);
3066 3063
3067
3068 if (bnx2x_has_rx_work(fp)) { 3064 if (bnx2x_has_rx_work(fp)) {
3069 work_done += bnx2x_rx_int(fp, budget - work_done); 3065 work_done += bnx2x_rx_int(fp, budget - work_done);
3070 3066
@@ -3337,12 +3333,12 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb,
3337 * 57712 related 3333 * 57712 related
3338 */ 3334 */
3339static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb, 3335static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb,
3340 u32 *parsing_data, u32 xmit_type) 3336 u32 *parsing_data, u32 xmit_type)
3341{ 3337{
3342 *parsing_data |= 3338 *parsing_data |=
3343 ((((u8 *)skb_transport_header(skb) - skb->data) >> 1) << 3339 ((((u8 *)skb_transport_header(skb) - skb->data) >> 1) <<
3344 ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) & 3340 ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) &
3345 ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W; 3341 ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W;
3346 3342
3347 if (xmit_type & XMIT_CSUM_TCP) { 3343 if (xmit_type & XMIT_CSUM_TCP) {
3348 *parsing_data |= ((tcp_hdrlen(skb) / 4) << 3344 *parsing_data |= ((tcp_hdrlen(skb) / 4) <<
@@ -3488,8 +3484,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
3488 dev_kfree_skb(skb); 3484 dev_kfree_skb(skb);
3489 return NETDEV_TX_OK; 3485 return NETDEV_TX_OK;
3490 } 3486 }
3491 bnx2x_fp_qstats(bp, txdata->parent_fp)->driver_xoff++; 3487 bnx2x_fp_qstats(bp, txdata->parent_fp)->driver_xoff++;
3492 netif_tx_stop_queue(txq); 3488 netif_tx_stop_queue(txq);
3493 BNX2X_ERR("BUG! Tx ring full when queue awake!\n"); 3489 BNX2X_ERR("BUG! Tx ring full when queue awake!\n");
3494 3490
3495 return NETDEV_TX_BUSY; 3491 return NETDEV_TX_BUSY;
@@ -4254,7 +4250,7 @@ int bnx2x_alloc_mem_bp(struct bnx2x *bp)
4254 4250
4255 /* 4251 /*
4256 * The biggest MSI-X table we might need is as a maximum number of fast 4252 * The biggest MSI-X table we might need is as a maximum number of fast
4257 * path IGU SBs plus default SB (for PF). 4253 * path IGU SBs plus default SB (for PF only).
4258 */ 4254 */
4259 msix_table_size = bp->igu_sb_cnt; 4255 msix_table_size = bp->igu_sb_cnt;
4260 if (IS_PF(bp)) 4256 if (IS_PF(bp))
@@ -4364,7 +4360,7 @@ int bnx2x_get_link_cfg_idx(struct bnx2x *bp)
4364{ 4360{
4365 u32 sel_phy_idx = bnx2x_get_cur_phy_idx(bp); 4361 u32 sel_phy_idx = bnx2x_get_cur_phy_idx(bp);
4366 /* 4362 /*
4367 * The selected actived PHY is always after swapping (in case PHY 4363 * The selected activated PHY is always after swapping (in case PHY
4368 * swapping is enabled). So when swapping is enabled, we need to reverse 4364 * swapping is enabled). So when swapping is enabled, we need to reverse
4369 * the configuration 4365 * the configuration
4370 */ 4366 */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index faad34fae5c9..d126c852b82e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -975,7 +975,6 @@ static inline int bnx2x_func_start(struct bnx2x *bp)
975 return bnx2x_func_state_change(bp, &func_params); 975 return bnx2x_func_state_change(bp, &func_params);
976} 976}
977 977
978
979/** 978/**
980 * bnx2x_set_fw_mac_addr - fill in a MAC address in FW format 979 * bnx2x_set_fw_mac_addr - fill in a MAC address in FW format
981 * 980 *
@@ -1391,7 +1390,7 @@ static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr)
1391} 1390}
1392 1391
1393/** 1392/**
1394 * bnx2x_fill_fw_str - Fill buffer with FW version string. 1393 * bnx2x_fill_fw_str - Fill buffer with FW version string
1395 * 1394 *
1396 * @bp: driver handle 1395 * @bp: driver handle
1397 * @buf: character buffer to fill with the fw name 1396 * @buf: character buffer to fill with the fw name
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
index 37a2e9a31a3e..568205436a15 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
@@ -416,6 +416,7 @@ static void bnx2x_pfc_set_pfc(struct bnx2x *bp)
416 int mfw_configured = SHMEM2_HAS(bp, drv_flags) && 416 int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
417 GET_FLAGS(SHMEM2_RD(bp, drv_flags), 417 GET_FLAGS(SHMEM2_RD(bp, drv_flags),
418 1 << DRV_FLAGS_DCB_MFW_CONFIGURED); 418 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
419
419 if (bp->dcbx_port_params.pfc.enabled && 420 if (bp->dcbx_port_params.pfc.enabled &&
420 (!(bp->dcbx_error & DCBX_REMOTE_MIB_ERROR) || mfw_configured)) 421 (!(bp->dcbx_error & DCBX_REMOTE_MIB_ERROR) || mfw_configured))
421 /* 422 /*
@@ -558,6 +559,7 @@ static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp)
558 int mfw_configured = SHMEM2_HAS(bp, drv_flags) && 559 int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
559 GET_FLAGS(SHMEM2_RD(bp, drv_flags), 560 GET_FLAGS(SHMEM2_RD(bp, drv_flags),
560 1 << DRV_FLAGS_DCB_MFW_CONFIGURED); 561 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
562
561 bnx2x_ets_disabled(&bp->link_params, &bp->link_vars); 563 bnx2x_ets_disabled(&bp->link_params, &bp->link_vars);
562 564
563 if (!bp->dcbx_port_params.ets.enabled || 565 if (!bp->dcbx_port_params.ets.enabled ||
@@ -1904,11 +1906,13 @@ static u8 bnx2x_dcbnl_set_state(struct net_device *netdev, u8 state)
1904 struct bnx2x *bp = netdev_priv(netdev); 1906 struct bnx2x *bp = netdev_priv(netdev);
1905 DP(BNX2X_MSG_DCB, "state = %s\n", state ? "on" : "off"); 1907 DP(BNX2X_MSG_DCB, "state = %s\n", state ? "on" : "off");
1906 1908
1909 /* Fail to set state to "enabled" if dcbx is disabled in nvram */
1907 if (state && ((bp->dcbx_enabled == BNX2X_DCBX_ENABLED_OFF) || 1910 if (state && ((bp->dcbx_enabled == BNX2X_DCBX_ENABLED_OFF) ||
1908 (bp->dcbx_enabled == BNX2X_DCBX_ENABLED_INVALID))) { 1911 (bp->dcbx_enabled == BNX2X_DCBX_ENABLED_INVALID))) {
1909 DP(BNX2X_MSG_DCB, "Can not set dcbx to enabled while it is disabled in nvm\n"); 1912 DP(BNX2X_MSG_DCB, "Can not set dcbx to enabled while it is disabled in nvm\n");
1910 return 1; 1913 return 1;
1911 } 1914 }
1915
1912 bnx2x_dcbx_set_state(bp, (state ? true : false), bp->dcbx_enabled); 1916 bnx2x_dcbx_set_state(bp, (state ? true : false), bp->dcbx_enabled);
1913 return 0; 1917 return 0;
1914} 1918}
@@ -2052,7 +2056,6 @@ static void bnx2x_dcbnl_set_pfc_cfg(struct net_device *netdev, int prio,
2052 if (!bnx2x_dcbnl_set_valid(bp) || prio >= MAX_PFC_PRIORITIES) 2056 if (!bnx2x_dcbnl_set_valid(bp) || prio >= MAX_PFC_PRIORITIES)
2053 return; 2057 return;
2054 2058
2055
2056 if (setting) { 2059 if (setting) {
2057 bp->dcbx_config_params.admin_pfc_bitmap |= (1 << prio); 2060 bp->dcbx_config_params.admin_pfc_bitmap |= (1 << prio);
2058 bp->dcbx_config_params.admin_pfc_tx_enable = 1; 2061 bp->dcbx_config_params.admin_pfc_tx_enable = 1;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 6292aa140eaa..8bdd857981ce 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -234,7 +234,7 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
234 234
235 if ((bp->state == BNX2X_STATE_OPEN) && bp->link_vars.link_up && 235 if ((bp->state == BNX2X_STATE_OPEN) && bp->link_vars.link_up &&
236 !(bp->flags & MF_FUNC_DIS)) { 236 !(bp->flags & MF_FUNC_DIS)) {
237 cmd->duplex = bp->link_vars.duplex; 237 cmd->duplex = bp->link_vars.duplex;
238 238
239 if (IS_MF(bp) && !BP_NOMCP(bp)) 239 if (IS_MF(bp) && !BP_NOMCP(bp))
240 ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp)); 240 ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp));
@@ -400,7 +400,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
400 DP(BNX2X_MSG_ETHTOOL, "Unsupported port type\n"); 400 DP(BNX2X_MSG_ETHTOOL, "Unsupported port type\n");
401 return -EINVAL; 401 return -EINVAL;
402 } 402 }
403 /* Save new config in case command complete successully */ 403 /* Save new config in case command complete successfully */
404 new_multi_phy_config = bp->link_params.multi_phy_config; 404 new_multi_phy_config = bp->link_params.multi_phy_config;
405 /* Get the new cfg_idx */ 405 /* Get the new cfg_idx */
406 cfg_idx = bnx2x_get_link_cfg_idx(bp); 406 cfg_idx = bnx2x_get_link_cfg_idx(bp);
@@ -751,11 +751,10 @@ static bool bnx2x_is_wreg_in_chip(struct bnx2x *bp,
751 * @bp device handle 751 * @bp device handle
752 * @p output buffer 752 * @p output buffer
753 * 753 *
754 * Reads "paged" memories: memories that may only be read by 754 * Reads "paged" memories: memories that may only be read by first writing to a
755 * first writing to a specific address ("write address") and 755 * specific address ("write address") and then reading from a specific address
756 * then reading from a specific address ("read address"). There 756 * ("read address"). There may be more than one write address per "page" and
757 * may be more than one write address per "page" and more than 757 * more than one read address per write address.
758 * one read address per write address.
759 */ 758 */
760static void bnx2x_read_pages_regs(struct bnx2x *bp, u32 *p, u32 preset) 759static void bnx2x_read_pages_regs(struct bnx2x *bp, u32 *p, u32 preset)
761{ 760{
@@ -1082,13 +1081,13 @@ static int bnx2x_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
1082 struct bnx2x *bp = netdev_priv(dev); 1081 struct bnx2x *bp = netdev_priv(dev);
1083 1082
1084 if (wol->wolopts & ~WAKE_MAGIC) { 1083 if (wol->wolopts & ~WAKE_MAGIC) {
1085 DP(BNX2X_MSG_ETHTOOL, "WOL not supproted\n"); 1084 DP(BNX2X_MSG_ETHTOOL, "WOL not supported\n");
1086 return -EINVAL; 1085 return -EINVAL;
1087 } 1086 }
1088 1087
1089 if (wol->wolopts & WAKE_MAGIC) { 1088 if (wol->wolopts & WAKE_MAGIC) {
1090 if (bp->flags & NO_WOL_FLAG) { 1089 if (bp->flags & NO_WOL_FLAG) {
1091 DP(BNX2X_MSG_ETHTOOL, "WOL not supproted\n"); 1090 DP(BNX2X_MSG_ETHTOOL, "WOL not supported\n");
1092 return -EINVAL; 1091 return -EINVAL;
1093 } 1092 }
1094 bp->wol = 1; 1093 bp->wol = 1;
@@ -1161,7 +1160,7 @@ static int bnx2x_get_eeprom_len(struct net_device *dev)
1161 * Pf B takes the lock and proceeds to perform it's own access. 1160 * Pf B takes the lock and proceeds to perform it's own access.
1162 * pf A unlocks the per port lock, while pf B is still working (!). 1161 * pf A unlocks the per port lock, while pf B is still working (!).
1163 * mcp takes the per port lock and corrupts pf B's access (and/or has it's own 1162 * mcp takes the per port lock and corrupts pf B's access (and/or has it's own
1164 * acess corrupted by pf B).* 1163 * access corrupted by pf B)
1165 */ 1164 */
1166static int bnx2x_acquire_nvram_lock(struct bnx2x *bp) 1165static int bnx2x_acquire_nvram_lock(struct bnx2x *bp)
1167{ 1166{
@@ -1970,7 +1969,6 @@ static int bnx2x_set_eee(struct net_device *dev, struct ethtool_eee *edata)
1970 return 0; 1969 return 0;
1971} 1970}
1972 1971
1973
1974enum { 1972enum {
1975 BNX2X_CHIP_E1_OFST = 0, 1973 BNX2X_CHIP_E1_OFST = 0,
1976 BNX2X_CHIP_E1H_OFST, 1974 BNX2X_CHIP_E1H_OFST,
@@ -2621,6 +2619,7 @@ static void bnx2x_self_test(struct net_device *dev,
2621 etest->flags |= ETH_TEST_FL_FAILED; 2619 etest->flags |= ETH_TEST_FL_FAILED;
2622 return; 2620 return;
2623 } 2621 }
2622
2624 DP(BNX2X_MSG_ETHTOOL, 2623 DP(BNX2X_MSG_ETHTOOL,
2625 "Self-test command parameters: offline = %d, external_lb = %d\n", 2624 "Self-test command parameters: offline = %d, external_lb = %d\n",
2626 (etest->flags & ETH_TEST_FL_OFFLINE), 2625 (etest->flags & ETH_TEST_FL_OFFLINE),
@@ -2976,15 +2975,14 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)
2976 DP(BNX2X_MSG_ETHTOOL, 2975 DP(BNX2X_MSG_ETHTOOL,
2977 "Command parameters not supported\n"); 2976 "Command parameters not supported\n");
2978 return -EINVAL; 2977 return -EINVAL;
2979 } else {
2980 return 0;
2981 } 2978 }
2979 return 0;
2982 2980
2983 case UDP_V4_FLOW: 2981 case UDP_V4_FLOW:
2984 case UDP_V6_FLOW: 2982 case UDP_V6_FLOW:
2985 /* For UDP either 2-tupple hash or 4-tupple hash is supported */ 2983 /* For UDP either 2-tupple hash or 4-tupple hash is supported */
2986 if (info->data == (RXH_IP_SRC | RXH_IP_DST | 2984 if (info->data == (RXH_IP_SRC | RXH_IP_DST |
2987 RXH_L4_B_0_1 | RXH_L4_B_2_3)) 2985 RXH_L4_B_0_1 | RXH_L4_B_2_3))
2988 udp_rss_requested = 1; 2986 udp_rss_requested = 1;
2989 else if (info->data == (RXH_IP_SRC | RXH_IP_DST)) 2987 else if (info->data == (RXH_IP_SRC | RXH_IP_DST))
2990 udp_rss_requested = 0; 2988 udp_rss_requested = 0;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
index 2959f2a28ed5..e5f808377c91 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
@@ -305,12 +305,10 @@
305#define MAX_VLAN_CREDIT_E1H 0 /* Per Chip */ 305#define MAX_VLAN_CREDIT_E1H 0 /* Per Chip */
306#define MAX_VLAN_CREDIT_E2 272 /* Per Path */ 306#define MAX_VLAN_CREDIT_E2 272 /* Per Path */
307 307
308
309/* Maximal aggregation queues supported */ 308/* Maximal aggregation queues supported */
310#define ETH_MAX_AGGREGATION_QUEUES_E1 32 309#define ETH_MAX_AGGREGATION_QUEUES_E1 32
311#define ETH_MAX_AGGREGATION_QUEUES_E1H_E2 64 310#define ETH_MAX_AGGREGATION_QUEUES_E1H_E2 64
312 311
313
314#define ETH_NUM_OF_MCAST_BINS 256 312#define ETH_NUM_OF_MCAST_BINS 256
315#define ETH_NUM_OF_MCAST_ENGINES_E2 72 313#define ETH_NUM_OF_MCAST_ENGINES_E2 72
316 314
@@ -353,7 +351,6 @@
353/* max number of slow path commands per port */ 351/* max number of slow path commands per port */
354#define MAX_RAMRODS_PER_PORT 8 352#define MAX_RAMRODS_PER_PORT 8
355 353
356
357/**** DEFINES FOR TIMERS/CLOCKS RESOLUTIONS ****/ 354/**** DEFINES FOR TIMERS/CLOCKS RESOLUTIONS ****/
358 355
359#define TIMERS_TICK_SIZE_CHIP (1e-3) 356#define TIMERS_TICK_SIZE_CHIP (1e-3)
@@ -380,7 +377,6 @@
380 that is not mapped to priority*/ 377 that is not mapped to priority*/
381#define LLFC_TRAFFIC_TYPE_TO_PRIORITY_UNMAPPED 0xFF 378#define LLFC_TRAFFIC_TYPE_TO_PRIORITY_UNMAPPED 0xFF
382 379
383
384#define C_ERES_PER_PAGE \ 380#define C_ERES_PER_PAGE \
385 (PAGE_SIZE / BITS_TO_BYTES(STRUCT_SIZE(event_ring_elem))) 381 (PAGE_SIZE / BITS_TO_BYTES(STRUCT_SIZE(event_ring_elem)))
386#define C_ERE_PER_PAGE_MASK (C_ERES_PER_PAGE - 1) 382#define C_ERE_PER_PAGE_MASK (C_ERES_PER_PAGE - 1)
@@ -391,8 +387,6 @@
391 387
392#define INVALID_VNIC_ID 0xFF 388#define INVALID_VNIC_ID 0xFF
393 389
394
395#define UNDEF_IRO 0x80000000 390#define UNDEF_IRO 0x80000000
396 391
397
398#endif /* BNX2X_FW_DEFS_H */ 392#endif /* BNX2X_FW_DEFS_H */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index af7af0894d70..502cea13aa2e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -782,12 +782,16 @@ void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl)
782 printk("%s" "begin fw dump (mark 0x%x)\n", lvl, mark); 782 printk("%s" "begin fw dump (mark 0x%x)\n", lvl, mark);
783 783
784 printk("%s", lvl); 784 printk("%s", lvl);
785
786 /* dump buffer after the mark */
785 for (offset = mark; offset <= trace_shmem_base; offset += 0x8*4) { 787 for (offset = mark; offset <= trace_shmem_base; offset += 0x8*4) {
786 for (word = 0; word < 8; word++) 788 for (word = 0; word < 8; word++)
787 data[word] = htonl(REG_RD(bp, offset + 4*word)); 789 data[word] = htonl(REG_RD(bp, offset + 4*word));
788 data[8] = 0x0; 790 data[8] = 0x0;
789 pr_cont("%s", (char *)data); 791 pr_cont("%s", (char *)data);
790 } 792 }
793
794 /* dump buffer before the mark */
791 for (offset = addr + 4; offset <= mark; offset += 0x8*4) { 795 for (offset = addr + 4; offset <= mark; offset += 0x8*4) {
792 for (word = 0; word < 8; word++) 796 for (word = 0; word < 8; word++)
793 data[word] = htonl(REG_RD(bp, offset + 4*word)); 797 data[word] = htonl(REG_RD(bp, offset + 4*word));
@@ -1683,11 +1687,11 @@ static int bnx2x_get_leader_lock_resource(struct bnx2x *bp)
1683} 1687}
1684 1688
1685/** 1689/**
1686 * bnx2x_trylock_leader_lock- try to aquire a leader lock. 1690 * bnx2x_trylock_leader_lock- try to acquire a leader lock.
1687 * 1691 *
1688 * @bp: driver handle 1692 * @bp: driver handle
1689 * 1693 *
1690 * Tries to aquire a leader lock for current engine. 1694 * Tries to acquire a leader lock for current engine.
1691 */ 1695 */
1692static bool bnx2x_trylock_leader_lock(struct bnx2x *bp) 1696static bool bnx2x_trylock_leader_lock(struct bnx2x *bp)
1693{ 1697{
@@ -1804,7 +1808,7 @@ void bnx2x_sp_event(struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe)
1804 * mark pending ACK to MCP bit. 1808 * mark pending ACK to MCP bit.
1805 * prevent case that both bits are cleared. 1809 * prevent case that both bits are cleared.
1806 * At the end of load/unload driver checks that 1810 * At the end of load/unload driver checks that
1807 * sp_state is cleaerd, and this order prevents 1811 * sp_state is cleared, and this order prevents
1808 * races 1812 * races
1809 */ 1813 */
1810 smp_mb__before_clear_bit(); 1814 smp_mb__before_clear_bit();
@@ -3083,7 +3087,7 @@ static void bnx2x_pf_rx_q_prep(struct bnx2x *bp,
3083 3087
3084 /* Maximum number or simultaneous TPA aggregation for this Queue. 3088 /* Maximum number or simultaneous TPA aggregation for this Queue.
3085 * 3089 *
3086 * For PF Clients it should be the maximum avaliable number. 3090 * For PF Clients it should be the maximum available number.
3087 * VF driver(s) may want to define it to a smaller value. 3091 * VF driver(s) may want to define it to a smaller value.
3088 */ 3092 */
3089 rxq_init->max_tpa_queues = MAX_AGG_QS(bp); 3093 rxq_init->max_tpa_queues = MAX_AGG_QS(bp);
@@ -3796,7 +3800,7 @@ static void bnx2x_fan_failure(struct bnx2x *bp)
3796 "Please contact OEM Support for assistance\n"); 3800 "Please contact OEM Support for assistance\n");
3797 3801
3798 /* 3802 /*
3799 * Scheudle device reset (unload) 3803 * Schedule device reset (unload)
3800 * This is due to some boards consuming sufficient power when driver is 3804 * This is due to some boards consuming sufficient power when driver is
3801 * up to overheat if fan fails. 3805 * up to overheat if fan fails.
3802 */ 3806 */
@@ -4894,7 +4898,7 @@ static void bnx2x_after_function_update(struct bnx2x *bp)
4894 struct bnx2x_queue_update_params *q_update_params = 4898 struct bnx2x_queue_update_params *q_update_params =
4895 &queue_params.params.update; 4899 &queue_params.params.update;
4896 4900
4897 /* Send Q update command with afex vlan removal values for all Qs */ 4901 /* Send Q update command with afex vlan removal values for all Qs */
4898 queue_params.cmd = BNX2X_Q_CMD_UPDATE; 4902 queue_params.cmd = BNX2X_Q_CMD_UPDATE;
4899 4903
4900 /* set silent vlan removal values according to vlan mode */ 4904 /* set silent vlan removal values according to vlan mode */
@@ -4996,7 +5000,6 @@ static void bnx2x_eq_int(struct bnx2x *bp)
4996 for (; sw_cons != hw_cons; 5000 for (; sw_cons != hw_cons;
4997 sw_prod = NEXT_EQ_IDX(sw_prod), sw_cons = NEXT_EQ_IDX(sw_cons)) { 5001 sw_prod = NEXT_EQ_IDX(sw_prod), sw_cons = NEXT_EQ_IDX(sw_cons)) {
4998 5002
4999
5000 elem = &bp->eq_ring[EQ_DESC(sw_cons)]; 5003 elem = &bp->eq_ring[EQ_DESC(sw_cons)];
5001 5004
5002 rc = bnx2x_iov_eq_sp_event(bp, elem); 5005 rc = bnx2x_iov_eq_sp_event(bp, elem);
@@ -6480,7 +6483,7 @@ static int bnx2x_init_hw_common(struct bnx2x *bp)
6480 DP(NETIF_MSG_HW, "starting common init func %d\n", BP_ABS_FUNC(bp)); 6483 DP(NETIF_MSG_HW, "starting common init func %d\n", BP_ABS_FUNC(bp));
6481 6484
6482 /* 6485 /*
6483 * take the UNDI lock to protect undi_unload flow from accessing 6486 * take the RESET lock to protect undi_unload flow from accessing
6484 * registers while we're resetting the chip 6487 * registers while we're resetting the chip
6485 */ 6488 */
6486 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_RESET); 6489 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_RESET);
@@ -6610,7 +6613,7 @@ static int bnx2x_init_hw_common(struct bnx2x *bp)
6610 * queues with "old" ILT addresses. 6613 * queues with "old" ILT addresses.
6611 * c. PF enable in the PGLC. 6614 * c. PF enable in the PGLC.
6612 * d. Clear the was_error of the PF in the PGLC. (could have 6615 * d. Clear the was_error of the PF in the PGLC. (could have
6613 * occured while driver was down) 6616 * occurred while driver was down)
6614 * e. PF enable in the CFC (WEAK + STRONG) 6617 * e. PF enable in the CFC (WEAK + STRONG)
6615 * f. Timers scan enable 6618 * f. Timers scan enable
6616 * 3. PF driver unload flow: 6619 * 3. PF driver unload flow:
@@ -6651,7 +6654,7 @@ static int bnx2x_init_hw_common(struct bnx2x *bp)
6651 /* Step 1: set zeroes to all ilt page entries with valid bit on 6654 /* Step 1: set zeroes to all ilt page entries with valid bit on
6652 * Step 2: set the timers first/last ilt entry to point 6655 * Step 2: set the timers first/last ilt entry to point
6653 * to the entire range to prevent ILT range error for 3rd/4th 6656 * to the entire range to prevent ILT range error for 3rd/4th
6654 * vnic (this code assumes existance of the vnic) 6657 * vnic (this code assumes existence of the vnic)
6655 * 6658 *
6656 * both steps performed by call to bnx2x_ilt_client_init_op() 6659 * both steps performed by call to bnx2x_ilt_client_init_op()
6657 * with dummy TM client 6660 * with dummy TM client
@@ -6668,7 +6671,6 @@ static int bnx2x_init_hw_common(struct bnx2x *bp)
6668 REG_WR(bp, PXP2_REG_RQ_DRAM_ALIGN_SEL, 1); 6671 REG_WR(bp, PXP2_REG_RQ_DRAM_ALIGN_SEL, 1);
6669 } 6672 }
6670 6673
6671
6672 REG_WR(bp, PXP2_REG_RQ_DISABLE_INPUTS, 0); 6674 REG_WR(bp, PXP2_REG_RQ_DISABLE_INPUTS, 0);
6673 REG_WR(bp, PXP2_REG_RD_DISABLE_INPUTS, 0); 6675 REG_WR(bp, PXP2_REG_RD_DISABLE_INPUTS, 0);
6674 6676
@@ -7151,7 +7153,6 @@ static int bnx2x_init_hw_port(struct bnx2x *bp)
7151 } 7153 }
7152 } 7154 }
7153 7155
7154
7155 /* If SPIO5 is set to generate interrupts, enable it for this port */ 7156 /* If SPIO5 is set to generate interrupts, enable it for this port */
7156 val = REG_RD(bp, MISC_REG_SPIO_EVENT_EN); 7157 val = REG_RD(bp, MISC_REG_SPIO_EVENT_EN);
7157 if (val & MISC_SPIO_SPIO5) { 7158 if (val & MISC_SPIO_SPIO5) {
@@ -8335,8 +8336,8 @@ static void bnx2x_reset_func(struct bnx2x *bp)
8335 8336
8336 /* SP SB */ 8337 /* SP SB */
8337 REG_WR8(bp, BAR_CSTRORM_INTMEM + 8338 REG_WR8(bp, BAR_CSTRORM_INTMEM +
8338 CSTORM_SP_STATUS_BLOCK_DATA_STATE_OFFSET(func), 8339 CSTORM_SP_STATUS_BLOCK_DATA_STATE_OFFSET(func),
8339 SB_DISABLED); 8340 SB_DISABLED);
8340 8341
8341 for (i = 0; i < XSTORM_SPQ_DATA_SIZE / 4; i++) 8342 for (i = 0; i < XSTORM_SPQ_DATA_SIZE / 4; i++)
8342 REG_WR(bp, BAR_XSTRORM_INTMEM + XSTORM_SPQ_DATA_OFFSET(func), 8343 REG_WR(bp, BAR_XSTRORM_INTMEM + XSTORM_SPQ_DATA_OFFSET(func),
@@ -9078,8 +9079,7 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global)
9078 int cnt = 1000; 9079 int cnt = 1000;
9079 u32 val = 0; 9080 u32 val = 0;
9080 u32 sr_cnt, blk_cnt, port_is_idle_0, port_is_idle_1, pgl_exp_rom2; 9081 u32 sr_cnt, blk_cnt, port_is_idle_0, port_is_idle_1, pgl_exp_rom2;
9081 u32 tags_63_32 = 0; 9082 u32 tags_63_32 = 0;
9082
9083 9083
9084 /* Empty the Tetris buffer, wait for 1s */ 9084 /* Empty the Tetris buffer, wait for 1s */
9085 do { 9085 do {
@@ -9974,7 +9974,6 @@ static int bnx2x_prev_unload(struct bnx2x *bp)
9974 REG_WR(bp, MCP_REG_MCPR_ACCESS_LOCK, 0); 9974 REG_WR(bp, MCP_REG_MCPR_ACCESS_LOCK, 0);
9975 } 9975 }
9976 9976
9977
9978 do { 9977 do {
9979 /* Lock MCP using an unload request */ 9978 /* Lock MCP using an unload request */
9980 fw = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS, 0); 9979 fw = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS, 0);
@@ -10694,21 +10693,21 @@ static void bnx2x_get_fcoe_info(struct bnx2x *bp)
10694 /* Port info */ 10693 /* Port info */
10695 bp->cnic_eth_dev.fcoe_wwn_port_name_hi = 10694 bp->cnic_eth_dev.fcoe_wwn_port_name_hi =
10696 SHMEM_RD(bp, 10695 SHMEM_RD(bp,
10697 dev_info.port_hw_config[port]. 10696 dev_info.port_hw_config[port].
10698 fcoe_wwn_port_name_upper); 10697 fcoe_wwn_port_name_upper);
10699 bp->cnic_eth_dev.fcoe_wwn_port_name_lo = 10698 bp->cnic_eth_dev.fcoe_wwn_port_name_lo =
10700 SHMEM_RD(bp, 10699 SHMEM_RD(bp,
10701 dev_info.port_hw_config[port]. 10700 dev_info.port_hw_config[port].
10702 fcoe_wwn_port_name_lower); 10701 fcoe_wwn_port_name_lower);
10703 10702
10704 /* Node info */ 10703 /* Node info */
10705 bp->cnic_eth_dev.fcoe_wwn_node_name_hi = 10704 bp->cnic_eth_dev.fcoe_wwn_node_name_hi =
10706 SHMEM_RD(bp, 10705 SHMEM_RD(bp,
10707 dev_info.port_hw_config[port]. 10706 dev_info.port_hw_config[port].
10708 fcoe_wwn_node_name_upper); 10707 fcoe_wwn_node_name_upper);
10709 bp->cnic_eth_dev.fcoe_wwn_node_name_lo = 10708 bp->cnic_eth_dev.fcoe_wwn_node_name_lo =
10710 SHMEM_RD(bp, 10709 SHMEM_RD(bp,
10711 dev_info.port_hw_config[port]. 10710 dev_info.port_hw_config[port].
10712 fcoe_wwn_node_name_lower); 10711 fcoe_wwn_node_name_lower);
10713 } else if (!IS_MF_SD(bp)) { 10712 } else if (!IS_MF_SD(bp)) {
10714 /* 10713 /*
@@ -11611,7 +11610,6 @@ static int bnx2x_set_mc_list(struct bnx2x *bp)
11611 return rc; 11610 return rc;
11612} 11611}
11613 11612
11614
11615/* If bp->state is OPEN, should be called with netif_addr_lock_bh() */ 11613/* If bp->state is OPEN, should be called with netif_addr_lock_bh() */
11616void bnx2x_set_rx_mode(struct net_device *dev) 11614void bnx2x_set_rx_mode(struct net_device *dev)
11617{ 11615{
@@ -11899,13 +11897,14 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
11899 * support Physical Device Assignment where kernel BDF maybe arbitrary 11897 * support Physical Device Assignment where kernel BDF maybe arbitrary
11900 * (depending on hypervisor). 11898 * (depending on hypervisor).
11901 */ 11899 */
11902 if (chip_is_e1x) 11900 if (chip_is_e1x) {
11903 bp->pf_num = PCI_FUNC(pdev->devfn); 11901 bp->pf_num = PCI_FUNC(pdev->devfn);
11904 else {/* chip is E2/3*/ 11902 } else {
11903 /* chip is E2/3*/
11905 pci_read_config_dword(bp->pdev, 11904 pci_read_config_dword(bp->pdev,
11906 PCICFG_ME_REGISTER, &pci_cfg_dword); 11905 PCICFG_ME_REGISTER, &pci_cfg_dword);
11907 bp->pf_num = (u8)((pci_cfg_dword & ME_REG_ABS_PF_NUM) >> 11906 bp->pf_num = (u8)((pci_cfg_dword & ME_REG_ABS_PF_NUM) >>
11908 ME_REG_ABS_PF_NUM_SHIFT); 11907 ME_REG_ABS_PF_NUM_SHIFT);
11909 } 11908 }
11910 BNX2X_DEV_INFO("me reg PF num: %d\n", bp->pf_num); 11909 BNX2X_DEV_INFO("me reg PF num: %d\n", bp->pf_num);
11911 11910
@@ -12426,7 +12425,7 @@ static int bnx2x_init_one(struct pci_dev *pdev,
12426 BNX2X_DEV_INFO("Cnic support is %s\n", CNIC_SUPPORT(bp) ? "on" : "off"); 12425 BNX2X_DEV_INFO("Cnic support is %s\n", CNIC_SUPPORT(bp) ? "on" : "off");
12427 BNX2X_DEV_INFO("Max num of status blocks %d\n", max_non_def_sbs); 12426 BNX2X_DEV_INFO("Max num of status blocks %d\n", max_non_def_sbs);
12428 BNX2X_DEV_INFO("Allocated netdev with %d tx and %d rx queues\n", 12427 BNX2X_DEV_INFO("Allocated netdev with %d tx and %d rx queues\n",
12429 tx_count, rx_count); 12428 tx_count, rx_count);
12430 12429
12431 rc = bnx2x_init_bp(bp); 12430 rc = bnx2x_init_bp(bp);
12432 if (rc) 12431 if (rc)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index 8e8c91a3bfde..0c08abe1718d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -1442,7 +1442,7 @@ static int bnx2x_complete_vlan_mac(struct bnx2x *bp,
1442 if (cqe->message.error) 1442 if (cqe->message.error)
1443 return -EINVAL; 1443 return -EINVAL;
1444 1444
1445 /* Run the next bulk of pending commands if requeted */ 1445 /* Run the next bulk of pending commands if requested */
1446 if (test_bit(RAMROD_CONT, ramrod_flags)) { 1446 if (test_bit(RAMROD_CONT, ramrod_flags)) {
1447 rc = bnx2x_exe_queue_step(bp, &o->exe_queue, ramrod_flags); 1447 rc = bnx2x_exe_queue_step(bp, &o->exe_queue, ramrod_flags);
1448 if (rc < 0) 1448 if (rc < 0)
@@ -2103,7 +2103,7 @@ static inline void __storm_memset_mac_filters(struct bnx2x *bp,
2103static int bnx2x_set_rx_mode_e1x(struct bnx2x *bp, 2103static int bnx2x_set_rx_mode_e1x(struct bnx2x *bp,
2104 struct bnx2x_rx_mode_ramrod_params *p) 2104 struct bnx2x_rx_mode_ramrod_params *p)
2105{ 2105{
2106 /* update the bp MAC filter structure */ 2106 /* update the bp MAC filter structure */
2107 u32 mask = (1 << p->cl_id); 2107 u32 mask = (1 << p->cl_id);
2108 2108
2109 struct tstorm_eth_mac_filter_config *mac_filters = 2109 struct tstorm_eth_mac_filter_config *mac_filters =
@@ -2166,7 +2166,7 @@ static int bnx2x_set_rx_mode_e1x(struct bnx2x *bp,
2166 mac_filters->unmatched_unicast & ~mask; 2166 mac_filters->unmatched_unicast & ~mask;
2167 2167
2168 DP(BNX2X_MSG_SP, "drop_ucast 0x%x\ndrop_mcast 0x%x\n accp_ucast 0x%x\n" 2168 DP(BNX2X_MSG_SP, "drop_ucast 0x%x\ndrop_mcast 0x%x\n accp_ucast 0x%x\n"
2169 "accp_mcast 0x%x\naccp_bcast 0x%x\n", 2169 "accp_mcast 0x%x\naccp_bcast 0x%x\n",
2170 mac_filters->ucast_drop_all, mac_filters->mcast_drop_all, 2170 mac_filters->ucast_drop_all, mac_filters->mcast_drop_all,
2171 mac_filters->ucast_accept_all, mac_filters->mcast_accept_all, 2171 mac_filters->ucast_accept_all, mac_filters->mcast_accept_all,
2172 mac_filters->bcast_accept_all); 2172 mac_filters->bcast_accept_all);
@@ -2790,7 +2790,7 @@ static inline void bnx2x_mcast_hdl_add(struct bnx2x *bp,
2790 cnt++; 2790 cnt++;
2791 2791
2792 DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC\n", 2792 DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC\n",
2793 mlist_pos->mac); 2793 mlist_pos->mac);
2794 } 2794 }
2795 2795
2796 *line_idx = cnt; 2796 *line_idx = cnt;
@@ -3085,7 +3085,7 @@ static inline void bnx2x_mcast_hdl_add_e1h(struct bnx2x *bp,
3085 BNX2X_57711_SET_MC_FILTER(mc_filter, bit); 3085 BNX2X_57711_SET_MC_FILTER(mc_filter, bit);
3086 3086
3087 DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC, bin %d\n", 3087 DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC, bin %d\n",
3088 mlist_pos->mac, bit); 3088 mlist_pos->mac, bit);
3089 3089
3090 /* bookkeeping... */ 3090 /* bookkeeping... */
3091 BIT_VEC64_SET_BIT(o->registry.aprox_match.vec, 3091 BIT_VEC64_SET_BIT(o->registry.aprox_match.vec,
@@ -3319,7 +3319,7 @@ static inline int bnx2x_mcast_handle_restore_cmd_e1(
3319 i++; 3319 i++;
3320 3320
3321 DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC\n", 3321 DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC\n",
3322 cfg_data.mac); 3322 cfg_data.mac);
3323 } 3323 }
3324 3324
3325 *rdata_idx = i; 3325 *rdata_idx = i;
@@ -3355,7 +3355,7 @@ static inline int bnx2x_mcast_handle_pending_cmds_e1(
3355 cnt++; 3355 cnt++;
3356 3356
3357 DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC\n", 3357 DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC\n",
3358 pmac_pos->mac); 3358 pmac_pos->mac);
3359 } 3359 }
3360 break; 3360 break;
3361 3361
@@ -5652,9 +5652,9 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp,
5652 memset(rdata, 0, sizeof(*rdata)); 5652 memset(rdata, 0, sizeof(*rdata));
5653 5653
5654 /* Fill the ramrod data with provided parameters */ 5654 /* Fill the ramrod data with provided parameters */
5655 rdata->function_mode = (u8)start_params->mf_mode; 5655 rdata->function_mode = (u8)start_params->mf_mode;
5656 rdata->sd_vlan_tag = cpu_to_le16(start_params->sd_vlan_tag); 5656 rdata->sd_vlan_tag = cpu_to_le16(start_params->sd_vlan_tag);
5657 rdata->path_id = BP_PATH(bp); 5657 rdata->path_id = BP_PATH(bp);
5658 rdata->network_cos_mode = start_params->network_cos_mode; 5658 rdata->network_cos_mode = start_params->network_cos_mode;
5659 5659
5660 /* 5660 /*
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
index 0beac4bd1f27..ff8887cfdb3c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
@@ -54,7 +54,7 @@ typedef enum {
54 BNX2X_OBJ_TYPE_RX_TX, 54 BNX2X_OBJ_TYPE_RX_TX,
55} bnx2x_obj_type; 55} bnx2x_obj_type;
56 56
57/* Filtering states */ 57/* Public slow path states */
58enum { 58enum {
59 BNX2X_FILTER_MAC_PENDING, 59 BNX2X_FILTER_MAC_PENDING,
60 BNX2X_FILTER_VLAN_PENDING, 60 BNX2X_FILTER_VLAN_PENDING,