diff options
Diffstat (limited to 'drivers/net/bnx2.h')
| -rw-r--r-- | drivers/net/bnx2.h | 115 |
1 files changed, 84 insertions, 31 deletions
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 2377cc13bf61..c3c579f98ed0 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
| @@ -309,6 +309,7 @@ struct l2_fhdr { | |||
| 309 | #endif | 309 | #endif |
| 310 | }; | 310 | }; |
| 311 | 311 | ||
| 312 | #define BNX2_RX_OFFSET (sizeof(struct l2_fhdr) + 2) | ||
| 312 | 313 | ||
| 313 | /* | 314 | /* |
| 314 | * l2_context definition | 315 | * l2_context definition |
| @@ -4157,6 +4158,23 @@ struct l2_fhdr { | |||
| 4157 | 4158 | ||
| 4158 | 4159 | ||
| 4159 | /* | 4160 | /* |
| 4161 | * rlup_reg definition | ||
| 4162 | * offset: 0x2000 | ||
| 4163 | */ | ||
| 4164 | #define BNX2_RLUP_RSS_CONFIG 0x0000201c | ||
| 4165 | #define BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_XI (0x3L<<0) | ||
| 4166 | #define BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_OFF_XI (0L<<0) | ||
| 4167 | #define BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_ALL_XI (1L<<0) | ||
| 4168 | #define BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_IP_ONLY_XI (2L<<0) | ||
| 4169 | #define BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_RES_XI (3L<<0) | ||
| 4170 | #define BNX2_RLUP_RSS_CONFIG_IPV6_RSS_TYPE_XI (0x3L<<2) | ||
| 4171 | #define BNX2_RLUP_RSS_CONFIG_IPV6_RSS_TYPE_OFF_XI (0L<<2) | ||
| 4172 | #define BNX2_RLUP_RSS_CONFIG_IPV6_RSS_TYPE_ALL_XI (1L<<2) | ||
| 4173 | #define BNX2_RLUP_RSS_CONFIG_IPV6_RSS_TYPE_IP_ONLY_XI (2L<<2) | ||
| 4174 | #define BNX2_RLUP_RSS_CONFIG_IPV6_RSS_TYPE_RES_XI (3L<<2) | ||
| 4175 | |||
| 4176 | |||
| 4177 | /* | ||
| 4160 | * rbuf_reg definition | 4178 | * rbuf_reg definition |
| 4161 | * offset: 0x200000 | 4179 | * offset: 0x200000 |
| 4162 | */ | 4180 | */ |
| @@ -5527,6 +5545,9 @@ struct l2_fhdr { | |||
| 5527 | #define BNX2_HC_TX_QUICK_CONS_TRIP_OFF (BNX2_HC_TX_QUICK_CONS_TRIP_1 - \ | 5545 | #define BNX2_HC_TX_QUICK_CONS_TRIP_OFF (BNX2_HC_TX_QUICK_CONS_TRIP_1 - \ |
| 5528 | BNX2_HC_SB_CONFIG_1) | 5546 | BNX2_HC_SB_CONFIG_1) |
| 5529 | #define BNX2_HC_TX_TICKS_OFF (BNX2_HC_TX_TICKS_1 - BNX2_HC_SB_CONFIG_1) | 5547 | #define BNX2_HC_TX_TICKS_OFF (BNX2_HC_TX_TICKS_1 - BNX2_HC_SB_CONFIG_1) |
| 5548 | #define BNX2_HC_RX_QUICK_CONS_TRIP_OFF (BNX2_HC_RX_QUICK_CONS_TRIP_1 - \ | ||
| 5549 | BNX2_HC_SB_CONFIG_1) | ||
| 5550 | #define BNX2_HC_RX_TICKS_OFF (BNX2_HC_RX_TICKS_1 - BNX2_HC_SB_CONFIG_1) | ||
| 5530 | 5551 | ||
| 5531 | 5552 | ||
| 5532 | /* | 5553 | /* |
| @@ -5855,6 +5876,9 @@ struct l2_fhdr { | |||
| 5855 | #define BNX2_RXP_FTQ_CTL_CUR_DEPTH (0x3ffL<<22) | 5876 | #define BNX2_RXP_FTQ_CTL_CUR_DEPTH (0x3ffL<<22) |
| 5856 | 5877 | ||
| 5857 | #define BNX2_RXP_SCRATCH 0x000e0000 | 5878 | #define BNX2_RXP_SCRATCH 0x000e0000 |
| 5879 | #define BNX2_RXP_SCRATCH_RSS_TBL_SZ 0x000e0038 | ||
| 5880 | #define BNX2_RXP_SCRATCH_RSS_TBL 0x000e003c | ||
| 5881 | #define BNX2_RXP_SCRATCH_RSS_TBL_MAX_ENTRIES 128 | ||
| 5858 | 5882 | ||
| 5859 | 5883 | ||
| 5860 | /* | 5884 | /* |
| @@ -6412,10 +6436,15 @@ struct l2_fhdr { | |||
| 6412 | #define MAX_ETHERNET_PACKET_SIZE 1514 | 6436 | #define MAX_ETHERNET_PACKET_SIZE 1514 |
| 6413 | #define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014 | 6437 | #define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014 |
| 6414 | 6438 | ||
| 6415 | #define RX_COPY_THRESH 128 | 6439 | #define BNX2_RX_COPY_THRESH 128 |
| 6416 | 6440 | ||
| 6417 | #define BNX2_MISC_ENABLE_DEFAULT 0x17ffffff | 6441 | #define BNX2_MISC_ENABLE_DEFAULT 0x17ffffff |
| 6418 | 6442 | ||
| 6443 | #define BNX2_START_UNICAST_ADDRESS_INDEX 4 | ||
| 6444 | #define BNX2_END_UNICAST_ADDRESS_INDEX 7 | ||
| 6445 | #define BNX2_MAX_UNICAST_ADDRESSES (BNX2_END_UNICAST_ADDRESS_INDEX - \ | ||
| 6446 | BNX2_START_UNICAST_ADDRESS_INDEX + 1) | ||
| 6447 | |||
| 6419 | #define DMA_READ_CHANS 5 | 6448 | #define DMA_READ_CHANS 5 |
| 6420 | #define DMA_WRITE_CHANS 3 | 6449 | #define DMA_WRITE_CHANS 3 |
| 6421 | 6450 | ||
| @@ -6478,6 +6507,11 @@ struct l2_fhdr { | |||
| 6478 | #define TX_CID 16 | 6507 | #define TX_CID 16 |
| 6479 | #define TX_TSS_CID 32 | 6508 | #define TX_TSS_CID 32 |
| 6480 | #define RX_CID 0 | 6509 | #define RX_CID 0 |
| 6510 | #define RX_RSS_CID 4 | ||
| 6511 | #define RX_MAX_RSS_RINGS 7 | ||
| 6512 | #define RX_MAX_RINGS (RX_MAX_RSS_RINGS + 1) | ||
| 6513 | #define TX_MAX_TSS_RINGS 7 | ||
| 6514 | #define TX_MAX_RINGS (TX_MAX_TSS_RINGS + 1) | ||
| 6481 | 6515 | ||
| 6482 | #define MB_TX_CID_ADDR MB_GET_CID_ADDR(TX_CID) | 6516 | #define MB_TX_CID_ADDR MB_GET_CID_ADDR(TX_CID) |
| 6483 | #define MB_RX_CID_ADDR MB_GET_CID_ADDR(RX_CID) | 6517 | #define MB_RX_CID_ADDR MB_GET_CID_ADDR(RX_CID) |
| @@ -6556,7 +6590,7 @@ struct flash_spec { | |||
| 6556 | }; | 6590 | }; |
| 6557 | 6591 | ||
| 6558 | #define BNX2_MAX_MSIX_HW_VEC 9 | 6592 | #define BNX2_MAX_MSIX_HW_VEC 9 |
| 6559 | #define BNX2_MAX_MSIX_VEC 2 | 6593 | #define BNX2_MAX_MSIX_VEC 9 |
| 6560 | #define BNX2_BASE_VEC 0 | 6594 | #define BNX2_BASE_VEC 0 |
| 6561 | #define BNX2_TX_VEC 1 | 6595 | #define BNX2_TX_VEC 1 |
| 6562 | #define BNX2_TX_INT_NUM (BNX2_TX_VEC << BNX2_PCICFG_INT_ACK_CMD_INT_NUM_SHIFT) | 6596 | #define BNX2_TX_INT_NUM (BNX2_TX_VEC << BNX2_PCICFG_INT_ACK_CMD_INT_NUM_SHIFT) |
| @@ -6568,24 +6602,56 @@ struct bnx2_irq { | |||
| 6568 | char name[16]; | 6602 | char name[16]; |
| 6569 | }; | 6603 | }; |
| 6570 | 6604 | ||
| 6571 | struct bnx2_napi { | 6605 | struct bnx2_tx_ring_info { |
| 6572 | struct napi_struct napi ____cacheline_aligned; | 6606 | u32 tx_prod_bseq; |
| 6573 | struct bnx2 *bp; | 6607 | u16 tx_prod; |
| 6574 | struct status_block *status_blk; | 6608 | u32 tx_bidx_addr; |
| 6575 | struct status_block_msix *status_blk_msix; | 6609 | u32 tx_bseq_addr; |
| 6576 | u32 last_status_idx; | 6610 | |
| 6577 | u32 int_num; | 6611 | struct tx_bd *tx_desc_ring; |
| 6612 | struct sw_bd *tx_buf_ring; | ||
| 6578 | 6613 | ||
| 6579 | u16 tx_cons; | 6614 | u16 tx_cons; |
| 6580 | u16 hw_tx_cons; | 6615 | u16 hw_tx_cons; |
| 6581 | 6616 | ||
| 6617 | dma_addr_t tx_desc_mapping; | ||
| 6618 | }; | ||
| 6619 | |||
| 6620 | struct bnx2_rx_ring_info { | ||
| 6582 | u32 rx_prod_bseq; | 6621 | u32 rx_prod_bseq; |
| 6583 | u16 rx_prod; | 6622 | u16 rx_prod; |
| 6584 | u16 rx_cons; | 6623 | u16 rx_cons; |
| 6585 | 6624 | ||
| 6625 | u32 rx_bidx_addr; | ||
| 6626 | u32 rx_bseq_addr; | ||
| 6627 | u32 rx_pg_bidx_addr; | ||
| 6628 | |||
| 6586 | u16 rx_pg_prod; | 6629 | u16 rx_pg_prod; |
| 6587 | u16 rx_pg_cons; | 6630 | u16 rx_pg_cons; |
| 6588 | 6631 | ||
| 6632 | struct sw_bd *rx_buf_ring; | ||
| 6633 | struct rx_bd *rx_desc_ring[MAX_RX_RINGS]; | ||
| 6634 | struct sw_pg *rx_pg_ring; | ||
| 6635 | struct rx_bd *rx_pg_desc_ring[MAX_RX_PG_RINGS]; | ||
| 6636 | |||
| 6637 | dma_addr_t rx_desc_mapping[MAX_RX_RINGS]; | ||
| 6638 | dma_addr_t rx_pg_desc_mapping[MAX_RX_PG_RINGS]; | ||
| 6639 | }; | ||
| 6640 | |||
| 6641 | struct bnx2_napi { | ||
| 6642 | struct napi_struct napi ____cacheline_aligned; | ||
| 6643 | struct bnx2 *bp; | ||
| 6644 | union { | ||
| 6645 | struct status_block *msi; | ||
| 6646 | struct status_block_msix *msix; | ||
| 6647 | } status_blk; | ||
| 6648 | u16 *hw_tx_cons_ptr; | ||
| 6649 | u16 *hw_rx_cons_ptr; | ||
| 6650 | u32 last_status_idx; | ||
| 6651 | u32 int_num; | ||
| 6652 | |||
| 6653 | struct bnx2_rx_ring_info rx_ring; | ||
| 6654 | struct bnx2_tx_ring_info tx_ring; | ||
| 6589 | }; | 6655 | }; |
| 6590 | 6656 | ||
| 6591 | struct bnx2 { | 6657 | struct bnx2 { |
| @@ -6612,14 +6678,7 @@ struct bnx2 { | |||
| 6612 | #define BNX2_FLAG_USING_MSI_OR_MSIX (BNX2_FLAG_USING_MSI | \ | 6678 | #define BNX2_FLAG_USING_MSI_OR_MSIX (BNX2_FLAG_USING_MSI | \ |
| 6613 | BNX2_FLAG_USING_MSIX) | 6679 | BNX2_FLAG_USING_MSIX) |
| 6614 | #define BNX2_FLAG_JUMBO_BROKEN 0x00000800 | 6680 | #define BNX2_FLAG_JUMBO_BROKEN 0x00000800 |
| 6615 | 6681 | #define BNX2_FLAG_CAN_KEEP_VLAN 0x00001000 | |
| 6616 | /* Put tx producer and consumer fields in separate cache lines. */ | ||
| 6617 | |||
| 6618 | u32 tx_prod_bseq __attribute__((aligned(L1_CACHE_BYTES))); | ||
| 6619 | u16 tx_prod; | ||
| 6620 | u8 tx_vec; | ||
| 6621 | u32 tx_bidx_addr; | ||
| 6622 | u32 tx_bseq_addr; | ||
| 6623 | 6682 | ||
| 6624 | struct bnx2_napi bnx2_napi[BNX2_MAX_MSIX_VEC]; | 6683 | struct bnx2_napi bnx2_napi[BNX2_MAX_MSIX_VEC]; |
| 6625 | 6684 | ||
| @@ -6627,7 +6686,6 @@ struct bnx2 { | |||
| 6627 | struct vlan_group *vlgrp; | 6686 | struct vlan_group *vlgrp; |
| 6628 | #endif | 6687 | #endif |
| 6629 | 6688 | ||
| 6630 | u32 rx_offset; | ||
| 6631 | u32 rx_buf_use_size; /* useable size */ | 6689 | u32 rx_buf_use_size; /* useable size */ |
| 6632 | u32 rx_buf_size; /* with alignment */ | 6690 | u32 rx_buf_size; /* with alignment */ |
| 6633 | u32 rx_copy_thresh; | 6691 | u32 rx_copy_thresh; |
| @@ -6637,14 +6695,7 @@ struct bnx2 { | |||
| 6637 | 6695 | ||
| 6638 | u32 rx_csum; | 6696 | u32 rx_csum; |
| 6639 | 6697 | ||
| 6640 | struct sw_bd *rx_buf_ring; | ||
| 6641 | struct rx_bd *rx_desc_ring[MAX_RX_RINGS]; | ||
| 6642 | struct sw_pg *rx_pg_ring; | ||
| 6643 | struct rx_bd *rx_pg_desc_ring[MAX_RX_PG_RINGS]; | ||
| 6644 | |||
| 6645 | /* TX constants */ | 6698 | /* TX constants */ |
| 6646 | struct tx_bd *tx_desc_ring; | ||
| 6647 | struct sw_bd *tx_buf_ring; | ||
| 6648 | int tx_ring_size; | 6699 | int tx_ring_size; |
| 6649 | u32 tx_wake_thresh; | 6700 | u32 tx_wake_thresh; |
| 6650 | 6701 | ||
| @@ -6722,16 +6773,11 @@ struct bnx2 { | |||
| 6722 | u16 fw_wr_seq; | 6773 | u16 fw_wr_seq; |
| 6723 | u16 fw_drv_pulse_wr_seq; | 6774 | u16 fw_drv_pulse_wr_seq; |
| 6724 | 6775 | ||
| 6725 | dma_addr_t tx_desc_mapping; | ||
| 6726 | |||
| 6727 | |||
| 6728 | int rx_max_ring; | 6776 | int rx_max_ring; |
| 6729 | int rx_ring_size; | 6777 | int rx_ring_size; |
| 6730 | dma_addr_t rx_desc_mapping[MAX_RX_RINGS]; | ||
| 6731 | 6778 | ||
| 6732 | int rx_max_pg_ring; | 6779 | int rx_max_pg_ring; |
| 6733 | int rx_pg_ring_size; | 6780 | int rx_pg_ring_size; |
| 6734 | dma_addr_t rx_pg_desc_mapping[MAX_RX_PG_RINGS]; | ||
| 6735 | 6781 | ||
| 6736 | u16 tx_quick_cons_trip; | 6782 | u16 tx_quick_cons_trip; |
| 6737 | u16 tx_quick_cons_trip_int; | 6783 | u16 tx_quick_cons_trip_int; |
| @@ -6750,7 +6796,6 @@ struct bnx2 { | |||
| 6750 | 6796 | ||
| 6751 | u32 stats_ticks; | 6797 | u32 stats_ticks; |
| 6752 | 6798 | ||
| 6753 | struct status_block *status_blk; | ||
| 6754 | dma_addr_t status_blk_mapping; | 6799 | dma_addr_t status_blk_mapping; |
| 6755 | 6800 | ||
| 6756 | struct statistics_block *stats_blk; | 6801 | struct statistics_block *stats_blk; |
| @@ -6812,6 +6857,9 @@ struct bnx2 { | |||
| 6812 | 6857 | ||
| 6813 | struct bnx2_irq irq_tbl[BNX2_MAX_MSIX_VEC]; | 6858 | struct bnx2_irq irq_tbl[BNX2_MAX_MSIX_VEC]; |
| 6814 | int irq_nvecs; | 6859 | int irq_nvecs; |
| 6860 | |||
| 6861 | u8 num_tx_rings; | ||
| 6862 | u8 num_rx_rings; | ||
| 6815 | }; | 6863 | }; |
| 6816 | 6864 | ||
| 6817 | #define REG_RD(bp, offset) \ | 6865 | #define REG_RD(bp, offset) \ |
| @@ -6912,6 +6960,7 @@ struct fw_info { | |||
| 6912 | #define BNX2_DRV_MSG_CODE_DIAG 0x07000000 | 6960 | #define BNX2_DRV_MSG_CODE_DIAG 0x07000000 |
| 6913 | #define BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL 0x09000000 | 6961 | #define BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL 0x09000000 |
| 6914 | #define BNX2_DRV_MSG_CODE_UNLOAD_LNK_DN 0x0b000000 | 6962 | #define BNX2_DRV_MSG_CODE_UNLOAD_LNK_DN 0x0b000000 |
| 6963 | #define BNX2_DRV_MSG_CODE_KEEP_VLAN_UPDATE 0x0d000000 | ||
| 6915 | #define BNX2_DRV_MSG_CODE_CMD_SET_LINK 0x10000000 | 6964 | #define BNX2_DRV_MSG_CODE_CMD_SET_LINK 0x10000000 |
| 6916 | 6965 | ||
| 6917 | #define BNX2_DRV_MSG_DATA 0x00ff0000 | 6966 | #define BNX2_DRV_MSG_DATA 0x00ff0000 |
| @@ -7240,6 +7289,10 @@ struct fw_info { | |||
| 7240 | #define BNX2_FW_CAP_SIGNATURE_MASK 0xffff0000 | 7289 | #define BNX2_FW_CAP_SIGNATURE_MASK 0xffff0000 |
| 7241 | #define BNX2_FW_CAP_REMOTE_PHY_CAPABLE 0x00000001 | 7290 | #define BNX2_FW_CAP_REMOTE_PHY_CAPABLE 0x00000001 |
| 7242 | #define BNX2_FW_CAP_REMOTE_PHY_PRESENT 0x00000002 | 7291 | #define BNX2_FW_CAP_REMOTE_PHY_PRESENT 0x00000002 |
| 7292 | #define BNX2_FW_CAP_MFW_CAN_KEEP_VLAN 0x00000008 | ||
| 7293 | #define BNX2_FW_CAP_BC_CAN_KEEP_VLAN 0x00000010 | ||
| 7294 | #define BNX2_FW_CAP_CAN_KEEP_VLAN (BNX2_FW_CAP_BC_CAN_KEEP_VLAN | \ | ||
| 7295 | BNX2_FW_CAP_MFW_CAN_KEEP_VLAN) | ||
| 7243 | 7296 | ||
| 7244 | #define BNX2_RPHY_SIGNATURE 0x36c | 7297 | #define BNX2_RPHY_SIGNATURE 0x36c |
| 7245 | #define BNX2_RPHY_LOAD_SIGNATURE 0x5a5a5a5a | 7298 | #define BNX2_RPHY_LOAD_SIGNATURE 0x5a5a5a5a |
