aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x/bnx2x.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2x/bnx2x.h')
-rw-r--r--drivers/net/bnx2x/bnx2x.h54
1 files changed, 28 insertions, 26 deletions
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index d80809f5ffc9..6fc77a4a5de6 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -180,13 +180,14 @@ void bnx2x_panic_dump(struct bnx2x *bp);
180#define SHMEM2_WR(bp, field, val) REG_WR(bp, SHMEM2_ADDR(bp, field), val) 180#define SHMEM2_WR(bp, field, val) REG_WR(bp, SHMEM2_ADDR(bp, field), val)
181#define MF_CFG_ADDR(bp, field) (bp->common.mf_cfg_base + \ 181#define MF_CFG_ADDR(bp, field) (bp->common.mf_cfg_base + \
182 offsetof(struct mf_cfg, field)) 182 offsetof(struct mf_cfg, field))
183#define MF2_CFG_ADDR(bp, field) (bp->common.mf2_cfg_base + \ 183#define MF2_CFG_ADDR(bp, field) (bp->common.mf2_cfg_base + \
184 offsetof(struct mf2_cfg, field)) 184 offsetof(struct mf2_cfg, field))
185 185
186#define MF_CFG_RD(bp, field) REG_RD(bp, MF_CFG_ADDR(bp, field)) 186#define MF_CFG_RD(bp, field) REG_RD(bp, MF_CFG_ADDR(bp, field))
187#define MF_CFG_WR(bp, field, val) REG_WR(bp,\ 187#define MF_CFG_WR(bp, field, val) REG_WR(bp,\
188 MF_CFG_ADDR(bp, field), (val)) 188 MF_CFG_ADDR(bp, field), (val))
189#define MF2_CFG_RD(bp, field) REG_RD(bp, MF2_CFG_ADDR(bp, field)) 189#define MF2_CFG_RD(bp, field) REG_RD(bp, MF2_CFG_ADDR(bp, field))
190
190#define SHMEM2_HAS(bp, field) ((bp)->common.shmem2_base && \ 191#define SHMEM2_HAS(bp, field) ((bp)->common.shmem2_base && \
191 (SHMEM2_RD((bp), size) > \ 192 (SHMEM2_RD((bp), size) > \
192 offsetof(struct shmem2_region, field))) 193 offsetof(struct shmem2_region, field)))
@@ -310,7 +311,7 @@ struct bnx2x_fastpath {
310 311
311#define BNX2X_NAPI_WEIGHT 128 312#define BNX2X_NAPI_WEIGHT 128
312 struct napi_struct napi; 313 struct napi_struct napi;
313 union host_hc_status_block status_blk; 314 union host_hc_status_block status_blk;
314 /* chip independed shortcuts into sb structure */ 315 /* chip independed shortcuts into sb structure */
315 __le16 *sb_index_values; 316 __le16 *sb_index_values;
316 __le16 *sb_running_index; 317 __le16 *sb_running_index;
@@ -349,8 +350,8 @@ struct bnx2x_fastpath {
349#define BNX2X_FP_STATE_TERMINATING 0xd0000 350#define BNX2X_FP_STATE_TERMINATING 0xd0000
350#define BNX2X_FP_STATE_TERMINATED 0xe0000 351#define BNX2X_FP_STATE_TERMINATED 0xe0000
351 352
352 u8 index; /* number in fp array */ 353 u8 index; /* number in fp array */
353 u8 cl_id; /* eth client id */ 354 u8 cl_id; /* eth client id */
354 u8 cl_qzone_id; 355 u8 cl_qzone_id;
355 u8 fw_sb_id; /* status block number in FW */ 356 u8 fw_sb_id; /* status block number in FW */
356 u8 igu_sb_id; /* status block number in HW */ 357 u8 igu_sb_id; /* status block number in HW */
@@ -375,8 +376,6 @@ struct bnx2x_fastpath {
375 u16 last_max_sge; 376 u16 last_max_sge;
376 __le16 *rx_cons_sb; 377 __le16 *rx_cons_sb;
377 378
378
379
380 unsigned long tx_pkt, 379 unsigned long tx_pkt,
381 rx_pkt, 380 rx_pkt,
382 rx_calls; 381 rx_calls;
@@ -977,7 +976,7 @@ struct bnx2x {
977 u32 mf2_config[E2_FUNC_MAX]; 976 u32 mf2_config[E2_FUNC_MAX];
978 u16 mf_ov; 977 u16 mf_ov;
979 u8 mf_mode; 978 u8 mf_mode;
980#define IS_MF(bp) (bp->mf_mode != 0) 979#define IS_MF(bp) (bp->mf_mode != 0)
981 980
982 u8 wol; 981 u8 wol;
983 982
@@ -1302,21 +1301,35 @@ struct bnx2x_func_init_params {
1302 for (var = 1; var < BNX2X_NUM_QUEUES(bp); var++) 1301 for (var = 1; var < BNX2X_NUM_QUEUES(bp); var++)
1303 1302
1304 1303
1304#define WAIT_RAMROD_POLL 0x01
1305#define WAIT_RAMROD_COMMON 0x02
1306int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx,
1307 int *state_p, int flags);
1308
1309/* dmae */
1305void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32); 1310void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32);
1306void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr, 1311void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr,
1307 u32 len32); 1312 u32 len32);
1313void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr,
1314 u32 addr, u32 len);
1315void bnx2x_post_dmae(struct bnx2x *bp, struct dmae_command *dmae, int idx);
1316u32 bnx2x_dmae_opcode_add_comp(u32 opcode, u8 comp_type);
1317u32 bnx2x_dmae_opcode_clr_src_reset(u32 opcode);
1318u32 bnx2x_dmae_opcode(struct bnx2x *bp, u8 src_type, u8 dst_type,
1319 bool with_comp, u8 comp_type);
1320
1308int bnx2x_get_gpio(struct bnx2x *bp, int gpio_num, u8 port); 1321int bnx2x_get_gpio(struct bnx2x *bp, int gpio_num, u8 port);
1309int bnx2x_set_gpio(struct bnx2x *bp, int gpio_num, u32 mode, u8 port); 1322int bnx2x_set_gpio(struct bnx2x *bp, int gpio_num, u32 mode, u8 port);
1310int bnx2x_set_gpio_int(struct bnx2x *bp, int gpio_num, u32 mode, u8 port); 1323int bnx2x_set_gpio_int(struct bnx2x *bp, int gpio_num, u32 mode, u8 port);
1311u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param); 1324u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param);
1312void bnx2x_reg_wr_ind(struct bnx2x *bp, u32 addr, u32 val); 1325void bnx2x_reg_wr_ind(struct bnx2x *bp, u32 addr, u32 val);
1313void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr, 1326
1314 u32 addr, u32 len);
1315void bnx2x_calc_fc_adv(struct bnx2x *bp); 1327void bnx2x_calc_fc_adv(struct bnx2x *bp);
1316int bnx2x_sp_post(struct bnx2x *bp, int command, int cid, 1328int bnx2x_sp_post(struct bnx2x *bp, int command, int cid,
1317 u32 data_hi, u32 data_lo, int common); 1329 u32 data_hi, u32 data_lo, int common);
1318void bnx2x_update_coalesce(struct bnx2x *bp); 1330void bnx2x_update_coalesce(struct bnx2x *bp);
1319int bnx2x_get_link_cfg_idx(struct bnx2x *bp); 1331int bnx2x_get_link_cfg_idx(struct bnx2x *bp);
1332
1320static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, 1333static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1321 int wait) 1334 int wait)
1322{ 1335{
@@ -1333,6 +1346,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1333 1346
1334 return val; 1347 return val;
1335} 1348}
1349
1336#define BNX2X_ILT_ZALLOC(x, y, size) \ 1350#define BNX2X_ILT_ZALLOC(x, y, size) \
1337 do { \ 1351 do { \
1338 x = pci_alloc_consistent(bp->pdev, size, y); \ 1352 x = pci_alloc_consistent(bp->pdev, size, y); \
@@ -1353,6 +1367,8 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1353 1367
1354#define ILT_NUM_PAGE_ENTRIES (3072) 1368#define ILT_NUM_PAGE_ENTRIES (3072)
1355/* In 57710/11 we use whole table since we have 8 func 1369/* In 57710/11 we use whole table since we have 8 func
1370 * In 57712 we have only 4 func, but use same size per func, then only half of
1371 * the table in use
1356 */ 1372 */
1357#define ILT_PER_FUNC (ILT_NUM_PAGE_ENTRIES/8) 1373#define ILT_PER_FUNC (ILT_NUM_PAGE_ENTRIES/8)
1358 1374
@@ -1366,14 +1382,13 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1366#define ONCHIP_ADDR1(x) ((u32)(((u64)x >> 12) & 0xFFFFFFFF)) 1382#define ONCHIP_ADDR1(x) ((u32)(((u64)x >> 12) & 0xFFFFFFFF))
1367#define ONCHIP_ADDR2(x) ((u32)((1 << 20) | ((u64)x >> 44))) 1383#define ONCHIP_ADDR2(x) ((u32)((1 << 20) | ((u64)x >> 44)))
1368 1384
1369
1370/* load/unload mode */ 1385/* load/unload mode */
1371#define LOAD_NORMAL 0 1386#define LOAD_NORMAL 0
1372#define LOAD_OPEN 1 1387#define LOAD_OPEN 1
1373#define LOAD_DIAG 2 1388#define LOAD_DIAG 2
1374#define UNLOAD_NORMAL 0 1389#define UNLOAD_NORMAL 0
1375#define UNLOAD_CLOSE 1 1390#define UNLOAD_CLOSE 1
1376#define UNLOAD_RECOVERY 2 1391#define UNLOAD_RECOVERY 2
1377 1392
1378 1393
1379/* DMAE command defines */ 1394/* DMAE command defines */
@@ -1447,7 +1462,6 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1447#define PMF_DMAE_C(bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \ 1462#define PMF_DMAE_C(bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \
1448 E1HVN_MAX) 1463 E1HVN_MAX)
1449 1464
1450
1451/* PCIE link and speed */ 1465/* PCIE link and speed */
1452#define PCICFG_LINK_WIDTH 0x1f00000 1466#define PCICFG_LINK_WIDTH 0x1f00000
1453#define PCICFG_LINK_WIDTH_SHIFT 20 1467#define PCICFG_LINK_WIDTH_SHIFT 20
@@ -1596,6 +1610,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1596#define BNX2X_SP_DSB_INDEX \ 1610#define BNX2X_SP_DSB_INDEX \
1597 (&bp->def_status_blk->sp_sb.\ 1611 (&bp->def_status_blk->sp_sb.\
1598 index_values[HC_SP_INDEX_ETH_DEF_CONS]) 1612 index_values[HC_SP_INDEX_ETH_DEF_CONS])
1613
1599#define SET_FLAG(value, mask, flag) \ 1614#define SET_FLAG(value, mask, flag) \
1600 do {\ 1615 do {\
1601 (value) &= ~(mask);\ 1616 (value) &= ~(mask);\
@@ -1630,6 +1645,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1630#ifndef ETH_MAX_RX_CLIENTS_E2 1645#ifndef ETH_MAX_RX_CLIENTS_E2
1631#define ETH_MAX_RX_CLIENTS_E2 ETH_MAX_RX_CLIENTS_E1H 1646#define ETH_MAX_RX_CLIENTS_E2 ETH_MAX_RX_CLIENTS_E1H
1632#endif 1647#endif
1648
1633#define BNX2X_VPD_LEN 128 1649#define BNX2X_VPD_LEN 128
1634#define VENDOR_ID_LEN 4 1650#define VENDOR_ID_LEN 4
1635 1651
@@ -1649,20 +1665,6 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1649 1665
1650BNX2X_EXTERN int load_count[2][3]; /* per path: 0-common, 1-port0, 2-port1 */ 1666BNX2X_EXTERN int load_count[2][3]; /* per path: 0-common, 1-port0, 2-port1 */
1651 1667
1652/* MISC_REG_RESET_REG - this is here for the hsi to work don't touch */
1653
1654extern void bnx2x_set_ethtool_ops(struct net_device *netdev); 1668extern void bnx2x_set_ethtool_ops(struct net_device *netdev);
1655 1669
1656void bnx2x_post_dmae(struct bnx2x *bp, struct dmae_command *dmae, int idx);
1657u32 bnx2x_dmae_opcode_add_comp(u32 opcode, u8 comp_type);
1658u32 bnx2x_dmae_opcode_clr_src_reset(u32 opcode);
1659u32 bnx2x_dmae_opcode(struct bnx2x *bp, u8 src_type, u8 dst_type,
1660 bool with_comp, u8 comp_type);
1661
1662
1663#define WAIT_RAMROD_POLL 0x01
1664#define WAIT_RAMROD_COMMON 0x02
1665
1666int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx,
1667 int *state_p, int flags);
1668#endif /* bnx2x.h */ 1670#endif /* bnx2x.h */