bnx2x.h (aa1262b3876ec5249ff464618a7dcd46b3ca54e2) | bnx2x.h (a848ade408b6bfab59d575d6c246efb20afe88e3) |
---|---|
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 * --- 478 unchanged lines hidden (view full) --- 487enum bnx2x_tpa_mode_t { 488 TPA_MODE_LRO, 489 TPA_MODE_GRO 490}; 491 492struct bnx2x_fastpath { 493 struct bnx2x *bp; /* parent */ 494 | 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 * --- 478 unchanged lines hidden (view full) --- 487enum bnx2x_tpa_mode_t { 488 TPA_MODE_LRO, 489 TPA_MODE_GRO 490}; 491 492struct bnx2x_fastpath { 493 struct bnx2x *bp; /* parent */ 494 |
495#define BNX2X_NAPI_WEIGHT 128 | |
496 struct napi_struct napi; 497 union host_hc_status_block status_blk; 498 /* chip independed shortcuts into sb structure */ 499 __le16 *sb_index_values; 500 __le16 *sb_running_index; 501 /* chip independed shortcut into rx_prods_offset memory */ 502 u32 ustorm_rx_prods_offset; 503 --- 104 unchanged lines hidden (view full) --- 608/* number of NEXT_PAGE descriptors may be required during placement */ 609#define NEXT_CNT_PER_TX_PKT(bds) \ 610 (((bds) + MAX_TX_DESC_CNT - 1) / \ 611 MAX_TX_DESC_CNT * NEXT_PAGE_TX_DESC_CNT) 612/* max BDs per tx packet w/o next_pages: 613 * START_BD - describes packed 614 * START_BD(splitted) - includes unpaged data segment for GSO 615 * PARSING_BD - for TSO and CSUM data | 495 struct napi_struct napi; 496 union host_hc_status_block status_blk; 497 /* chip independed shortcuts into sb structure */ 498 __le16 *sb_index_values; 499 __le16 *sb_running_index; 500 /* chip independed shortcut into rx_prods_offset memory */ 501 u32 ustorm_rx_prods_offset; 502 --- 104 unchanged lines hidden (view full) --- 607/* number of NEXT_PAGE descriptors may be required during placement */ 608#define NEXT_CNT_PER_TX_PKT(bds) \ 609 (((bds) + MAX_TX_DESC_CNT - 1) / \ 610 MAX_TX_DESC_CNT * NEXT_PAGE_TX_DESC_CNT) 611/* max BDs per tx packet w/o next_pages: 612 * START_BD - describes packed 613 * START_BD(splitted) - includes unpaged data segment for GSO 614 * PARSING_BD - for TSO and CSUM data |
615 * PARSING_BD2 - for encapsulation data |
|
616 * Frag BDs - decribes pages for frags 617 */ | 616 * Frag BDs - decribes pages for frags 617 */ |
618#define BDS_PER_TX_PKT 3 | 618#define BDS_PER_TX_PKT 4 |
619#define MAX_BDS_PER_TX_PKT (MAX_SKB_FRAGS + BDS_PER_TX_PKT) 620/* max BDs per tx packet including next pages */ 621#define MAX_DESC_PER_TX_PKT (MAX_BDS_PER_TX_PKT + \ 622 NEXT_CNT_PER_TX_PKT(MAX_BDS_PER_TX_PKT)) 623 624/* The RX BD ring is special, each bd is 8 bytes but the last one is 16 */ 625#define NUM_RX_RINGS 8 626#define RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd)) --- 98 unchanged lines hidden (view full) --- 725 726 727/* TX CSUM helpers */ 728#define SKB_CS_OFF(skb) (offsetof(struct tcphdr, check) - \ 729 skb->csum_offset) 730#define SKB_CS(skb) (*(u16 *)(skb_transport_header(skb) + \ 731 skb->csum_offset)) 732 | 619#define MAX_BDS_PER_TX_PKT (MAX_SKB_FRAGS + BDS_PER_TX_PKT) 620/* max BDs per tx packet including next pages */ 621#define MAX_DESC_PER_TX_PKT (MAX_BDS_PER_TX_PKT + \ 622 NEXT_CNT_PER_TX_PKT(MAX_BDS_PER_TX_PKT)) 623 624/* The RX BD ring is special, each bd is 8 bytes but the last one is 16 */ 625#define NUM_RX_RINGS 8 626#define RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd)) --- 98 unchanged lines hidden (view full) --- 725 726 727/* TX CSUM helpers */ 728#define SKB_CS_OFF(skb) (offsetof(struct tcphdr, check) - \ 729 skb->csum_offset) 730#define SKB_CS(skb) (*(u16 *)(skb_transport_header(skb) + \ 731 skb->csum_offset)) 732 |
733#define pbd_tcp_flags(skb) (ntohl(tcp_flag_word(tcp_hdr(skb)))>>16 & 0xff) | 733#define pbd_tcp_flags(tcp_hdr) (ntohl(tcp_flag_word(tcp_hdr))>>16 & 0xff) |
734 | 734 |
735#define XMIT_PLAIN 0 736#define XMIT_CSUM_V4 0x1 737#define XMIT_CSUM_V6 0x2 738#define XMIT_CSUM_TCP 0x4 739#define XMIT_GSO_V4 0x8 740#define XMIT_GSO_V6 0x10 | 735#define XMIT_PLAIN 0 736#define XMIT_CSUM_V4 (1 << 0) 737#define XMIT_CSUM_V6 (1 << 1) 738#define XMIT_CSUM_TCP (1 << 2) 739#define XMIT_GSO_V4 (1 << 3) 740#define XMIT_GSO_V6 (1 << 4) 741#define XMIT_CSUM_ENC_V4 (1 << 5) 742#define XMIT_CSUM_ENC_V6 (1 << 6) 743#define XMIT_GSO_ENC_V4 (1 << 7) 744#define XMIT_GSO_ENC_V6 (1 << 8) |
741 | 745 |
742#define XMIT_CSUM (XMIT_CSUM_V4 | XMIT_CSUM_V6) 743#define XMIT_GSO (XMIT_GSO_V4 | XMIT_GSO_V6) | 746#define XMIT_CSUM_ENC (XMIT_CSUM_ENC_V4 | XMIT_CSUM_ENC_V6) 747#define XMIT_GSO_ENC (XMIT_GSO_ENC_V4 | XMIT_GSO_ENC_V6) |
744 | 748 |
749#define XMIT_CSUM (XMIT_CSUM_V4 | XMIT_CSUM_V6 | XMIT_CSUM_ENC) 750#define XMIT_GSO (XMIT_GSO_V4 | XMIT_GSO_V6 | XMIT_GSO_ENC) |
|
745 746/* stuff added to make the code fit 80Col */ 747#define CQE_TYPE(cqe_fp_flags) ((cqe_fp_flags) & ETH_FAST_PATH_RX_CQE_TYPE) 748#define CQE_TYPE_START(cqe_type) ((cqe_type) == RX_ETH_CQE_TYPE_ETH_START_AGG) 749#define CQE_TYPE_STOP(cqe_type) ((cqe_type) == RX_ETH_CQE_TYPE_ETH_STOP_AGG) 750#define CQE_TYPE_SLOW(cqe_type) ((cqe_type) == RX_ETH_CQE_TYPE_ETH_RAMROD) 751#define CQE_TYPE_FAST(cqe_type) ((cqe_type) == RX_ETH_CQE_TYPE_ETH_FASTPATH) 752 --- 457 unchanged lines hidden (view full) --- 1210enum { 1211 BNX2X_SP_RTNL_SETUP_TC, 1212 BNX2X_SP_RTNL_TX_TIMEOUT, 1213 BNX2X_SP_RTNL_FAN_FAILURE, 1214 BNX2X_SP_RTNL_AFEX_F_UPDATE, 1215 BNX2X_SP_RTNL_ENABLE_SRIOV, 1216 BNX2X_SP_RTNL_VFPF_MCAST, 1217 BNX2X_SP_RTNL_VFPF_STORM_RX_MODE, | 751 752/* stuff added to make the code fit 80Col */ 753#define CQE_TYPE(cqe_fp_flags) ((cqe_fp_flags) & ETH_FAST_PATH_RX_CQE_TYPE) 754#define CQE_TYPE_START(cqe_type) ((cqe_type) == RX_ETH_CQE_TYPE_ETH_START_AGG) 755#define CQE_TYPE_STOP(cqe_type) ((cqe_type) == RX_ETH_CQE_TYPE_ETH_STOP_AGG) 756#define CQE_TYPE_SLOW(cqe_type) ((cqe_type) == RX_ETH_CQE_TYPE_ETH_RAMROD) 757#define CQE_TYPE_FAST(cqe_type) ((cqe_type) == RX_ETH_CQE_TYPE_ETH_FASTPATH) 758 --- 457 unchanged lines hidden (view full) --- 1216enum { 1217 BNX2X_SP_RTNL_SETUP_TC, 1218 BNX2X_SP_RTNL_TX_TIMEOUT, 1219 BNX2X_SP_RTNL_FAN_FAILURE, 1220 BNX2X_SP_RTNL_AFEX_F_UPDATE, 1221 BNX2X_SP_RTNL_ENABLE_SRIOV, 1222 BNX2X_SP_RTNL_VFPF_MCAST, 1223 BNX2X_SP_RTNL_VFPF_STORM_RX_MODE, |
1224 BNX2X_SP_RTNL_HYPERVISOR_VLAN, |
|
1218}; 1219 1220 1221struct bnx2x_prev_path_list { 1222 u8 bus; 1223 u8 slot; 1224 u8 path; 1225 struct list_head list; --- 50 unchanged lines hidden (view full) --- 1276 /* we set aside a copy of the acquire response */ 1277 struct pfvf_acquire_resp_tlv acquire_resp; 1278 1279 /* bulletin board for messages from pf to vf */ 1280 union pf_vf_bulletin *pf2vf_bulletin; 1281 dma_addr_t pf2vf_bulletin_mapping; 1282 1283 struct pf_vf_bulletin_content old_bulletin; | 1225}; 1226 1227 1228struct bnx2x_prev_path_list { 1229 u8 bus; 1230 u8 slot; 1231 u8 path; 1232 struct list_head list; --- 50 unchanged lines hidden (view full) --- 1283 /* we set aside a copy of the acquire response */ 1284 struct pfvf_acquire_resp_tlv acquire_resp; 1285 1286 /* bulletin board for messages from pf to vf */ 1287 union pf_vf_bulletin *pf2vf_bulletin; 1288 dma_addr_t pf2vf_bulletin_mapping; 1289 1290 struct pf_vf_bulletin_content old_bulletin; |
1291 1292 u16 requested_nr_virtfn; |
|
1284#endif /* CONFIG_BNX2X_SRIOV */ 1285 1286 struct net_device *dev; 1287 struct pci_dev *pdev; 1288 1289 const struct iro *iro_arr; 1290#define IRO (bp->iro_arr) 1291 --- 647 unchanged lines hidden (view full) --- 1939 } while (ms > 0); 1940 1941 return val; 1942} 1943 1944void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id, 1945 bool is_pf); 1946 | 1293#endif /* CONFIG_BNX2X_SRIOV */ 1294 1295 struct net_device *dev; 1296 struct pci_dev *pdev; 1297 1298 const struct iro *iro_arr; 1299#define IRO (bp->iro_arr) 1300 --- 647 unchanged lines hidden (view full) --- 1948 } while (ms > 0); 1949 1950 return val; 1951} 1952 1953void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id, 1954 bool is_pf); 1955 |
1947#define BNX2X_ILT_ZALLOC(x, y, size) \ 1948 do { \ 1949 x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \ 1950 if (x) \ 1951 memset(x, 0, size); \ 1952 } while (0) | 1956#define BNX2X_ILT_ZALLOC(x, y, size) \ 1957 x = dma_alloc_coherent(&bp->pdev->dev, size, y, \ 1958 GFP_KERNEL | __GFP_ZERO) |
1953 1954#define BNX2X_ILT_FREE(x, y, size) \ 1955 do { \ 1956 if (x) { \ 1957 dma_free_coherent(&bp->pdev->dev, size, x, y); \ 1958 x = NULL; \ 1959 y = 0; \ 1960 } \ --- 320 unchanged lines hidden (view full) --- 2281 2282static const u32 dmae_reg_go_c[] = { 2283 DMAE_REG_GO_C0, DMAE_REG_GO_C1, DMAE_REG_GO_C2, DMAE_REG_GO_C3, 2284 DMAE_REG_GO_C4, DMAE_REG_GO_C5, DMAE_REG_GO_C6, DMAE_REG_GO_C7, 2285 DMAE_REG_GO_C8, DMAE_REG_GO_C9, DMAE_REG_GO_C10, DMAE_REG_GO_C11, 2286 DMAE_REG_GO_C12, DMAE_REG_GO_C13, DMAE_REG_GO_C14, DMAE_REG_GO_C15 2287}; 2288 | 1959 1960#define BNX2X_ILT_FREE(x, y, size) \ 1961 do { \ 1962 if (x) { \ 1963 dma_free_coherent(&bp->pdev->dev, size, x, y); \ 1964 x = NULL; \ 1965 y = 0; \ 1966 } \ --- 320 unchanged lines hidden (view full) --- 2287 2288static const u32 dmae_reg_go_c[] = { 2289 DMAE_REG_GO_C0, DMAE_REG_GO_C1, DMAE_REG_GO_C2, DMAE_REG_GO_C3, 2290 DMAE_REG_GO_C4, DMAE_REG_GO_C5, DMAE_REG_GO_C6, DMAE_REG_GO_C7, 2291 DMAE_REG_GO_C8, DMAE_REG_GO_C9, DMAE_REG_GO_C10, DMAE_REG_GO_C11, 2292 DMAE_REG_GO_C12, DMAE_REG_GO_C13, DMAE_REG_GO_C14, DMAE_REG_GO_C15 2293}; 2294 |
2289void bnx2x_set_ethtool_ops(struct net_device *netdev); | 2295void bnx2x_set_ethtool_ops(struct bnx2x *bp, struct net_device *netdev); |
2290void bnx2x_notify_link_changed(struct bnx2x *bp); 2291 2292#define BNX2X_MF_SD_PROTOCOL(bp) \ 2293 ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK) 2294 2295#define BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) \ 2296 (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI) 2297 --- 34 unchanged lines hidden --- | 2296void bnx2x_notify_link_changed(struct bnx2x *bp); 2297 2298#define BNX2X_MF_SD_PROTOCOL(bp) \ 2299 ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK) 2300 2301#define BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) \ 2302 (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI) 2303 --- 34 unchanged lines hidden --- |