bnx2x.h (db985cbd67c45f875ef43cb5febfaa8cbd203c27) bnx2x.h (2e98ffc21cacb170c2d2c01d110ed53fedb95768)
1/* bnx2x.h: Broadcom Everest network driver.
2 *
3 * Copyright (c) 2007-2013 Broadcom Corporation
4 *
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
7 * the Free Software Foundation.
8 *

--- 6 unchanged lines hidden (view full) ---

15#define BNX2X_H
16
17#include <linux/pci.h>
18#include <linux/netdevice.h>
19#include <linux/dma-mapping.h>
20#include <linux/types.h>
21#include <linux/pci_regs.h>
22
1/* bnx2x.h: Broadcom Everest network driver.
2 *
3 * Copyright (c) 2007-2013 Broadcom Corporation
4 *
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
7 * the Free Software Foundation.
8 *

--- 6 unchanged lines hidden (view full) ---

15#define BNX2X_H
16
17#include <linux/pci.h>
18#include <linux/netdevice.h>
19#include <linux/dma-mapping.h>
20#include <linux/types.h>
21#include <linux/pci_regs.h>
22
23#include <linux/ptp_clock_kernel.h>
24#include <linux/net_tstamp.h>
25#include <linux/clocksource.h>
26
23/* compilation time flags */
24
25/* define this to make the driver freeze on error to allow getting debug info
26 * (you will need to reboot afterwards) */
27/* #define BNX2X_STOP_ON_ERROR */
28
27/* compilation time flags */
28
29/* define this to make the driver freeze on error to allow getting debug info
30 * (you will need to reboot afterwards) */
31/* #define BNX2X_STOP_ON_ERROR */
32
29#define DRV_MODULE_VERSION "1.78.19-0"
33#define DRV_MODULE_VERSION "1.710.51-0"
30#define DRV_MODULE_RELDATE "2014/02/10"
31#define BNX2X_BC_VER 0x040200
32
33#if defined(CONFIG_DCB)
34#define BCM_DCBNL
35#endif
36
37#include "bnx2x_hsi.h"

--- 27 unchanged lines hidden (view full) ---

65#define BNX2X_MSG_OFF 0x0
66#define BNX2X_MSG_MCP 0x0010000 /* was: NETIF_MSG_HW */
67#define BNX2X_MSG_STATS 0x0020000 /* was: NETIF_MSG_TIMER */
68#define BNX2X_MSG_NVM 0x0040000 /* was: NETIF_MSG_HW */
69#define BNX2X_MSG_DMAE 0x0080000 /* was: NETIF_MSG_HW */
70#define BNX2X_MSG_SP 0x0100000 /* was: NETIF_MSG_INTR */
71#define BNX2X_MSG_FP 0x0200000 /* was: NETIF_MSG_INTR */
72#define BNX2X_MSG_IOV 0x0800000
34#define DRV_MODULE_RELDATE "2014/02/10"
35#define BNX2X_BC_VER 0x040200
36
37#if defined(CONFIG_DCB)
38#define BCM_DCBNL
39#endif
40
41#include "bnx2x_hsi.h"

--- 27 unchanged lines hidden (view full) ---

69#define BNX2X_MSG_OFF 0x0
70#define BNX2X_MSG_MCP 0x0010000 /* was: NETIF_MSG_HW */
71#define BNX2X_MSG_STATS 0x0020000 /* was: NETIF_MSG_TIMER */
72#define BNX2X_MSG_NVM 0x0040000 /* was: NETIF_MSG_HW */
73#define BNX2X_MSG_DMAE 0x0080000 /* was: NETIF_MSG_HW */
74#define BNX2X_MSG_SP 0x0100000 /* was: NETIF_MSG_INTR */
75#define BNX2X_MSG_FP 0x0200000 /* was: NETIF_MSG_INTR */
76#define BNX2X_MSG_IOV 0x0800000
77#define BNX2X_MSG_PTP 0x1000000
73#define BNX2X_MSG_IDLE 0x2000000 /* used for idle check*/
74#define BNX2X_MSG_ETHTOOL 0x4000000
75#define BNX2X_MSG_DCB 0x8000000
76
77/* regular debug print */
78#define DP_INNER(fmt, ...) \
79 pr_notice("[%s:%d(%s)]" fmt, \
80 __func__, __LINE__, \

--- 1501 unchanged lines hidden (view full) ---

1582#define NO_ISCSI_FLAG (1 << 14)
1583#define NO_FCOE_FLAG (1 << 15)
1584#define BC_SUPPORTS_PFC_STATS (1 << 17)
1585#define TX_SWITCHING (1 << 18)
1586#define BC_SUPPORTS_FCOE_FEATURES (1 << 19)
1587#define USING_SINGLE_MSIX_FLAG (1 << 20)
1588#define BC_SUPPORTS_DCBX_MSG_NON_PMF (1 << 21)
1589#define IS_VF_FLAG (1 << 22)
78#define BNX2X_MSG_IDLE 0x2000000 /* used for idle check*/
79#define BNX2X_MSG_ETHTOOL 0x4000000
80#define BNX2X_MSG_DCB 0x8000000
81
82/* regular debug print */
83#define DP_INNER(fmt, ...) \
84 pr_notice("[%s:%d(%s)]" fmt, \
85 __func__, __LINE__, \

--- 1501 unchanged lines hidden (view full) ---

1587#define NO_ISCSI_FLAG (1 << 14)
1588#define NO_FCOE_FLAG (1 << 15)
1589#define BC_SUPPORTS_PFC_STATS (1 << 17)
1590#define TX_SWITCHING (1 << 18)
1591#define BC_SUPPORTS_FCOE_FEATURES (1 << 19)
1592#define USING_SINGLE_MSIX_FLAG (1 << 20)
1593#define BC_SUPPORTS_DCBX_MSG_NON_PMF (1 << 21)
1594#define IS_VF_FLAG (1 << 22)
1590#define INTERRUPTS_ENABLED_FLAG (1 << 23)
1591#define BC_SUPPORTS_RMMOD_CMD (1 << 24)
1592#define HAS_PHYS_PORT_ID (1 << 25)
1593#define AER_ENABLED (1 << 26)
1595#define BC_SUPPORTS_RMMOD_CMD (1 << 23)
1596#define HAS_PHYS_PORT_ID (1 << 24)
1597#define AER_ENABLED (1 << 25)
1598#define PTP_SUPPORTED (1 << 26)
1599#define TX_TIMESTAMPING_EN (1 << 27)
1594
1595#define BP_NOMCP(bp) ((bp)->flags & NO_MCP_FLAG)
1596
1597#ifdef CONFIG_BNX2X_SRIOV
1598#define IS_VF(bp) ((bp)->flags & IS_VF_FLAG)
1599#define IS_PF(bp) (!((bp)->flags & IS_VF_FLAG))
1600#else
1601#define IS_VF(bp) false

--- 77 unchanged lines hidden (view full) ---

1679#define BNX2X_STATE_OPEN 0x3000
1680#define BNX2X_STATE_CLOSING_WAIT4_HALT 0x4000
1681#define BNX2X_STATE_CLOSING_WAIT4_DELETE 0x5000
1682
1683#define BNX2X_STATE_DIAG 0xe000
1684#define BNX2X_STATE_ERROR 0xf000
1685
1686#define BNX2X_MAX_PRIORITY 8
1600
1601#define BP_NOMCP(bp) ((bp)->flags & NO_MCP_FLAG)
1602
1603#ifdef CONFIG_BNX2X_SRIOV
1604#define IS_VF(bp) ((bp)->flags & IS_VF_FLAG)
1605#define IS_PF(bp) (!((bp)->flags & IS_VF_FLAG))
1606#else
1607#define IS_VF(bp) false

--- 77 unchanged lines hidden (view full) ---

1685#define BNX2X_STATE_OPEN 0x3000
1686#define BNX2X_STATE_CLOSING_WAIT4_HALT 0x4000
1687#define BNX2X_STATE_CLOSING_WAIT4_DELETE 0x5000
1688
1689#define BNX2X_STATE_DIAG 0xe000
1690#define BNX2X_STATE_ERROR 0xf000
1691
1692#define BNX2X_MAX_PRIORITY 8
1687#define BNX2X_MAX_ENTRIES_PER_PRI 16
1688#define BNX2X_MAX_COS 3
1689#define BNX2X_MAX_TX_COS 2
1690 int num_queues;
1691 uint num_ethernet_queues;
1692 uint num_cnic_queues;
1693 int num_queues;
1694 uint num_ethernet_queues;
1695 uint num_cnic_queues;
1693 int num_napi_queues;
1694 int disable_tpa;
1695
1696 u32 rx_mode;
1697#define BNX2X_RX_MODE_NONE 0
1698#define BNX2X_RX_MODE_NORMAL 1
1699#define BNX2X_RX_MODE_ALLMULTI 2
1700#define BNX2X_RX_MODE_PROMISC 3
1701#define BNX2X_MAX_MULTICAST 64

--- 226 unchanged lines hidden (view full) ---

1928
1929 int fp_array_size;
1930 u32 dump_preset_idx;
1931 bool stats_started;
1932 struct semaphore stats_sema;
1933
1934 u8 phys_port_id[ETH_ALEN];
1935
1696 int disable_tpa;
1697
1698 u32 rx_mode;
1699#define BNX2X_RX_MODE_NONE 0
1700#define BNX2X_RX_MODE_NORMAL 1
1701#define BNX2X_RX_MODE_ALLMULTI 2
1702#define BNX2X_RX_MODE_PROMISC 3
1703#define BNX2X_MAX_MULTICAST 64

--- 226 unchanged lines hidden (view full) ---

1930
1931 int fp_array_size;
1932 u32 dump_preset_idx;
1933 bool stats_started;
1934 struct semaphore stats_sema;
1935
1936 u8 phys_port_id[ETH_ALEN];
1937
1938 /* PTP related context */
1939 struct ptp_clock *ptp_clock;
1940 struct ptp_clock_info ptp_clock_info;
1941 struct work_struct ptp_task;
1942 struct cyclecounter cyclecounter;
1943 struct timecounter timecounter;
1944 bool timecounter_init_done;
1945 struct sk_buff *ptp_tx_skb;
1946 unsigned long ptp_tx_start;
1947 bool hwtstamp_ioctl_called;
1948 u16 tx_type;
1949 u16 rx_filter;
1950
1936 struct bnx2x_link_report_data vf_link_vars;
1937};
1938
1939/* Tx queues may be less or equal to Rx queues */
1940extern int num_queues;
1941#define BNX2X_NUM_QUEUES(bp) (bp->num_queues)
1942#define BNX2X_NUM_ETH_QUEUES(bp) ((bp)->num_ethernet_queues)
1943#define BNX2X_NUM_NON_CNIC_QUEUES(bp) (BNX2X_NUM_QUEUES(bp) - \

--- 397 unchanged lines hidden (view full) ---

2341#define ATTN_GENERAL_ATTN_3 (1L << 15)
2342#define ATTN_GENERAL_ATTN_4 (1L << 13)
2343#define ATTN_GENERAL_ATTN_5 (1L << 14)
2344#define ATTN_GENERAL_ATTN_6 (1L << 15)
2345
2346#define ATTN_HARD_WIRED_MASK 0xff00
2347#define ATTENTION_ID 4
2348
1951 struct bnx2x_link_report_data vf_link_vars;
1952};
1953
1954/* Tx queues may be less or equal to Rx queues */
1955extern int num_queues;
1956#define BNX2X_NUM_QUEUES(bp) (bp->num_queues)
1957#define BNX2X_NUM_ETH_QUEUES(bp) ((bp)->num_ethernet_queues)
1958#define BNX2X_NUM_NON_CNIC_QUEUES(bp) (BNX2X_NUM_QUEUES(bp) - \

--- 397 unchanged lines hidden (view full) ---

2356#define ATTN_GENERAL_ATTN_3 (1L << 15)
2357#define ATTN_GENERAL_ATTN_4 (1L << 13)
2358#define ATTN_GENERAL_ATTN_5 (1L << 14)
2359#define ATTN_GENERAL_ATTN_6 (1L << 15)
2360
2361#define ATTN_HARD_WIRED_MASK 0xff00
2362#define ATTENTION_ID 4
2363
2349#define IS_MF_STORAGE_ONLY(bp) (IS_MF_STORAGE_SD(bp) || \
2364#define IS_MF_STORAGE_ONLY(bp) (IS_MF_STORAGE_PERSONALITY_ONLY(bp) || \
2350 IS_MF_FCOE_AFEX(bp))
2351
2352/* stuff added to make the code fit 80Col */
2353
2354#define BNX2X_PMF_LINK_ASSERT \
2355 GENERAL_ATTEN_OFFSET(LINK_SYNC_ATTENTION_BIT_FUNC_0 + BP_FUNC(bp))
2356
2357#define BNX2X_MC_ASSERT_BITS \

--- 159 unchanged lines hidden (view full) ---

2517#define BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) \
2518 (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI)
2519
2520#define BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp) \
2521 (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_FCOE)
2522
2523#define IS_MF_ISCSI_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp))
2524#define IS_MF_FCOE_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))
2365 IS_MF_FCOE_AFEX(bp))
2366
2367/* stuff added to make the code fit 80Col */
2368
2369#define BNX2X_PMF_LINK_ASSERT \
2370 GENERAL_ATTEN_OFFSET(LINK_SYNC_ATTENTION_BIT_FUNC_0 + BP_FUNC(bp))
2371
2372#define BNX2X_MC_ASSERT_BITS \

--- 159 unchanged lines hidden (view full) ---

2532#define BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) \
2533 (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI)
2534
2535#define BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp) \
2536 (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_FCOE)
2537
2538#define IS_MF_ISCSI_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp))
2539#define IS_MF_FCOE_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))
2540#define IS_MF_ISCSI_SI(bp) (IS_MF_SI(bp) && BNX2X_IS_MF_EXT_PROTOCOL_ISCSI(bp))
2525
2541
2526#define BNX2X_MF_EXT_PROTOCOL_FCOE(bp) ((bp)->mf_ext_config & \
2527 MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD)
2542#define IS_MF_ISCSI_ONLY(bp) (IS_MF_ISCSI_SD(bp) || IS_MF_ISCSI_SI(bp))
2528
2543
2529#define IS_MF_FCOE_AFEX(bp) (IS_MF_AFEX(bp) && BNX2X_MF_EXT_PROTOCOL_FCOE(bp))
2530#define IS_MF_STORAGE_SD(bp) (IS_MF_SD(bp) && \
2531 (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \
2532 BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)))
2544#define BNX2X_MF_EXT_PROTOCOL_MASK \
2545 (MACP_FUNC_CFG_FLAGS_ETHERNET | \
2546 MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD | \
2547 MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD)
2533
2548
2549#define BNX2X_MF_EXT_PROT(bp) ((bp)->mf_ext_config & \
2550 BNX2X_MF_EXT_PROTOCOL_MASK)
2551
2552#define BNX2X_HAS_MF_EXT_PROTOCOL_FCOE(bp) \
2553 (BNX2X_MF_EXT_PROT(bp) & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD)
2554
2555#define BNX2X_IS_MF_EXT_PROTOCOL_FCOE(bp) \
2556 (BNX2X_MF_EXT_PROT(bp) == MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD)
2557
2558#define BNX2X_IS_MF_EXT_PROTOCOL_ISCSI(bp) \
2559 (BNX2X_MF_EXT_PROT(bp) == MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD)
2560
2561#define IS_MF_FCOE_AFEX(bp) \
2562 (IS_MF_AFEX(bp) && BNX2X_IS_MF_EXT_PROTOCOL_FCOE(bp))
2563
2564#define IS_MF_SD_STORAGE_PERSONALITY_ONLY(bp) \
2565 (IS_MF_SD(bp) && \
2566 (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \
2567 BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)))
2568
2569#define IS_MF_SI_STORAGE_PERSONALITY_ONLY(bp) \
2570 (IS_MF_SI(bp) && \
2571 (BNX2X_IS_MF_EXT_PROTOCOL_ISCSI(bp) || \
2572 BNX2X_IS_MF_EXT_PROTOCOL_FCOE(bp)))
2573
2574#define IS_MF_STORAGE_PERSONALITY_ONLY(bp) \
2575 (IS_MF_SD_STORAGE_PERSONALITY_ONLY(bp) || \
2576 IS_MF_SI_STORAGE_PERSONALITY_ONLY(bp))
2577
2578
2534#define SET_FLAG(value, mask, flag) \
2535 do {\
2536 (value) &= ~(mask);\
2537 (value) |= ((flag) << (mask##_SHIFT));\
2538 } while (0)
2539
2540#define GET_FLAG(value, mask) \
2541 (((value) & (mask)) >> (mask##_SHIFT))

--- 12 unchanged lines hidden (view full) ---

2554
2555void bnx2x_update_mng_version(struct bnx2x *bp);
2556
2557#define MCPR_SCRATCH_BASE(bp) \
2558 (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH)
2559
2560#define E1H_MAX_MF_SB_COUNT (HC_SB_MAX_SB_E1X/(E1HVN_MAX * PORT_MAX))
2561
2579#define SET_FLAG(value, mask, flag) \
2580 do {\
2581 (value) &= ~(mask);\
2582 (value) |= ((flag) << (mask##_SHIFT));\
2583 } while (0)
2584
2585#define GET_FLAG(value, mask) \
2586 (((value) & (mask)) >> (mask##_SHIFT))

--- 12 unchanged lines hidden (view full) ---

2599
2600void bnx2x_update_mng_version(struct bnx2x *bp);
2601
2602#define MCPR_SCRATCH_BASE(bp) \
2603 (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH)
2604
2605#define E1H_MAX_MF_SB_COUNT (HC_SB_MAX_SB_E1X/(E1HVN_MAX * PORT_MAX))
2606
2607void bnx2x_init_ptp(struct bnx2x *bp);
2608int bnx2x_configure_ptp_filters(struct bnx2x *bp);
2609void bnx2x_set_rx_ts(struct bnx2x *bp, struct sk_buff *skb);
2610
2611#define BNX2X_MAX_PHC_DRIFT 31000000
2612#define BNX2X_PTP_TX_TIMEOUT
2613
2562#endif /* bnx2x.h */
2614#endif /* bnx2x.h */