From e343d55c0a624c5bb88cd6821a17586474f20271 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Wed, 12 Dec 2007 11:16:19 -0800 Subject: [BNX2]: Add ring constants. Define the various ring constants to make the code cleaner. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 30ba366608b..e6a2153e8b9 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6408,6 +6408,11 @@ struct sw_bd { DECLARE_PCI_UNMAP_ADDR(mapping) }; +#define SW_RXBD_RING_SIZE (sizeof(struct sw_bd) * RX_DESC_CNT) +#define RXBD_RING_SIZE (sizeof(struct rx_bd) * RX_DESC_CNT) +#define SW_TXBD_RING_SIZE (sizeof(struct sw_bd) * TX_DESC_CNT) +#define TXBD_RING_SIZE (sizeof(struct tx_bd) * TX_DESC_CNT) + /* Buffered flash (Atmel: AT45DB011B) specific information */ #define SEEPROM_PAGE_BITS 2 #define SEEPROM_PHY_PAGE_SIZE (1 << SEEPROM_PAGE_BITS) -- cgit v1.2.3 From 5d5d001504b4a415a008f7ac1adb9fbec1637811 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Wed, 12 Dec 2007 11:17:43 -0800 Subject: [BNX2]: Restructure RX ring init. code. Factor out the common functions that will be used to initialize the normal RX rings and the page rings. Change the copybreak constant RX_COPY_THRESH to 128. This same constant will be used for the max. size of the linear SKB when pages are used. Copybreak will be turned off when pages are used. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index e6a2153e8b9..8354efc1111 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -332,6 +332,11 @@ struct l2_fhdr { #define BNX2_L2CTX_NX_BDHADDR_LO 0x00000014 #define BNX2_L2CTX_NX_BDIDX 0x00000018 +#define BNX2_L2CTX_HOST_PG_BDIDX 0x00000044 +#define BNX2_L2CTX_PG_BUF_SIZE 0x00000048 +#define BNX2_L2CTX_RBDC_KEY 0x0000004c +#define BNX2_L2CTX_NX_PG_BDHADDR_HI 0x00000050 +#define BNX2_L2CTX_NX_PG_BDHADDR_LO 0x00000054 /* * pci_config_l definition @@ -6336,7 +6341,7 @@ struct l2_fhdr { #define MAX_ETHERNET_PACKET_SIZE 1514 #define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014 -#define RX_COPY_THRESH 92 +#define RX_COPY_THRESH 128 #define BNX2_MISC_ENABLE_DEFAULT 0x7ffffff @@ -6513,6 +6518,7 @@ struct bnx2 { u32 rx_offset; u32 rx_buf_use_size; /* useable size */ u32 rx_buf_size; /* with alignment */ + u32 rx_copy_thresh; u32 rx_max_ring_idx; u32 rx_prod_bseq; -- cgit v1.2.3 From 47bf4246a357d36762c9e7c282d7307152eb92e1 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Wed, 12 Dec 2007 11:19:12 -0800 Subject: [BNX2]: Add init. code to handle RX pages. Add new fields to keep track of the pages and the page rings. Add functions to allocate and free pages. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 8354efc1111..93c2436cb8b 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -335,6 +335,7 @@ struct l2_fhdr { #define BNX2_L2CTX_HOST_PG_BDIDX 0x00000044 #define BNX2_L2CTX_PG_BUF_SIZE 0x00000048 #define BNX2_L2CTX_RBDC_KEY 0x0000004c +#define BNX2_L2CTX_RBDC_JUMBO_KEY 0x3ffe #define BNX2_L2CTX_NX_PG_BDHADDR_HI 0x00000050 #define BNX2_L2CTX_NX_PG_BDHADDR_LO 0x00000054 @@ -4450,6 +4451,14 @@ struct l2_fhdr { #define BNX2_MQ_MEM_RD_DATA2_VALUE (0x3fffffffL<<0) #define BNX2_MQ_MEM_RD_DATA2_VALUE_XI (0x7fffffffL<<0) +#define BNX2_MQ_MAP_L2_3 0x00003d2c +#define BNX2_MQ_MAP_L2_3_MQ_OFFSET (0xffL<<0) +#define BNX2_MQ_MAP_L2_3_SZ (0x3L<<8) +#define BNX2_MQ_MAP_L2_3_CTX_OFFSET (0x2ffL<<10) +#define BNX2_MQ_MAP_L2_3_BIN_OFFSET (0x7L<<23) +#define BNX2_MQ_MAP_L2_3_ARM (0x3L<<26) +#define BNX2_MQ_MAP_L2_3_ENA (0x1L<<31) +#define BNX2_MQ_MAP_L2_3_DEFAULT 0x82004646 /* * tsch_reg definition @@ -6360,9 +6369,11 @@ struct l2_fhdr { #define MAX_TX_DESC_CNT (TX_DESC_CNT - 1) #define MAX_RX_RINGS 4 +#define MAX_RX_PG_RINGS 16 #define RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct rx_bd)) #define MAX_RX_DESC_CNT (RX_DESC_CNT - 1) #define MAX_TOTAL_RX_DESC_CNT (MAX_RX_DESC_CNT * MAX_RX_RINGS) +#define MAX_TOTAL_RX_PG_DESC_CNT (MAX_RX_DESC_CNT * MAX_RX_PG_RINGS) #define NEXT_TX_BD(x) (((x) & (MAX_TX_DESC_CNT - 1)) == \ (MAX_TX_DESC_CNT - 1)) ? \ @@ -6375,6 +6386,7 @@ struct l2_fhdr { (x) + 2 : (x) + 1 #define RX_RING_IDX(x) ((x) & bp->rx_max_ring_idx) +#define RX_PG_RING_IDX(x) ((x) & bp->rx_max_pg_ring_idx) #define RX_RING(x) (((x) & ~MAX_RX_DESC_CNT) >> (BCM_PAGE_BITS - 4)) #define RX_IDX(x) ((x) & MAX_RX_DESC_CNT) @@ -6413,7 +6425,13 @@ struct sw_bd { DECLARE_PCI_UNMAP_ADDR(mapping) }; +struct sw_pg { + struct page *page; + DECLARE_PCI_UNMAP_ADDR(mapping) +}; + #define SW_RXBD_RING_SIZE (sizeof(struct sw_bd) * RX_DESC_CNT) +#define SW_RXPG_RING_SIZE (sizeof(struct sw_pg) * RX_DESC_CNT) #define RXBD_RING_SIZE (sizeof(struct rx_bd) * RX_DESC_CNT) #define SW_TXBD_RING_SIZE (sizeof(struct sw_bd) * TX_DESC_CNT) #define TXBD_RING_SIZE (sizeof(struct tx_bd) * TX_DESC_CNT) @@ -6520,15 +6538,21 @@ struct bnx2 { u32 rx_buf_size; /* with alignment */ u32 rx_copy_thresh; u32 rx_max_ring_idx; + u32 rx_max_pg_ring_idx; u32 rx_prod_bseq; u16 rx_prod; u16 rx_cons; + u16 rx_pg_prod; + u16 rx_pg_cons; + u32 rx_csum; struct sw_bd *rx_buf_ring; struct rx_bd *rx_desc_ring[MAX_RX_RINGS]; + struct sw_pg *rx_pg_ring; + struct rx_bd *rx_pg_desc_ring[MAX_RX_PG_RINGS]; /* TX constants */ struct tx_bd *tx_desc_ring; @@ -6616,6 +6640,10 @@ struct bnx2 { int rx_ring_size; dma_addr_t rx_desc_mapping[MAX_RX_RINGS]; + int rx_max_pg_ring; + int rx_pg_ring_size; + dma_addr_t rx_pg_desc_mapping[MAX_RX_PG_RINGS]; + u16 tx_quick_cons_trip; u16 tx_quick_cons_trip_int; u16 rx_quick_cons_trip; -- cgit v1.2.3 From 1db82f2aec0766edd4a4f8d86283e91559350de7 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Wed, 12 Dec 2007 11:19:35 -0800 Subject: [BNX2]: Add fast path code to handle RX pages. Add function to reuse a page in case of allocation or other errors. Add code to construct the completed SKB with the additional data in the pages. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 93c2436cb8b..1f244faf362 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -259,6 +259,7 @@ struct l2_fhdr { #define L2_FHDR_STATUS_TCP_SEGMENT (1<<14) #define L2_FHDR_STATUS_UDP_DATAGRAM (1<<15) + #define L2_FHDR_STATUS_SPLIT (1<<16) #define L2_FHDR_ERRORS_BAD_CRC (1<<17) #define L2_FHDR_ERRORS_PHY_DECODE (1<<18) #define L2_FHDR_ERRORS_ALIGNMENT (1<<19) @@ -6537,6 +6538,7 @@ struct bnx2 { u32 rx_buf_use_size; /* useable size */ u32 rx_buf_size; /* with alignment */ u32 rx_copy_thresh; + u32 rx_jumbo_thresh; u32 rx_max_ring_idx; u32 rx_max_pg_ring_idx; -- cgit v1.2.3 From 6d866ffc69b0c3e584782f212a3f783708d31e9a Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 20 Dec 2007 19:56:09 -0800 Subject: [BNX2]: Restructure IRQ datastructures. Add a table to keep track of multiple IRQs and restructure the IRQ request and free functions so that they can be easily expanded to handle multiple IRQs. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 1f244faf362..1accf009312 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6494,6 +6494,15 @@ struct flash_spec { u8 *name; }; +#define BNX2_MAX_MSIX_HW_VEC 9 +#define BNX2_MAX_MSIX_VEC 1 + +struct bnx2_irq { + irq_handler_t handler; + u16 vector; + char name[16]; +}; + struct bnx2 { /* Fields used in the tx and intr/napi performance paths are grouped */ /* together in the beginning of the structure. */ @@ -6721,6 +6730,9 @@ struct bnx2 { u32 flash_size; int status_stats_size; + + struct bnx2_irq irq_tbl[BNX2_MAX_MSIX_VEC]; + int irq_nvecs; }; static u32 bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset); -- cgit v1.2.3 From 35efa7c1f4aa868d4a948a9069f20ccef1b3b28d Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 20 Dec 2007 19:56:37 -0800 Subject: [BNX2]: Introduce new bnx2_napi structure. Introduce a bnx2_napi structure that will hold a napi_struct and other fields to handle NAPI polling for the napi_struct. Various tx and rx indexes and status block pointers will be moved from the main bnx2 structure to this bnx2_napi structure. Most NAPI path functions are modified to be passed this bnx2_napi struct pointer. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 1accf009312..345b6db9a94 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6503,6 +6503,14 @@ struct bnx2_irq { char name[16]; }; +struct bnx2_napi { + struct napi_struct napi ____cacheline_aligned; + struct bnx2 *bp; + struct status_block *status_blk; + u32 last_status_idx; + u32 int_num; +}; + struct bnx2 { /* Fields used in the tx and intr/napi performance paths are grouped */ /* together in the beginning of the structure. */ @@ -6511,13 +6519,8 @@ struct bnx2 { struct net_device *dev; struct pci_dev *pdev; - struct napi_struct napi; - atomic_t intr_sem; - struct status_block *status_blk; - u32 last_status_idx; - u32 flags; #define PCIX_FLAG 0x00000001 #define PCI_32BIT_FLAG 0x00000002 @@ -6539,6 +6542,8 @@ struct bnx2 { u16 tx_cons __attribute__((aligned(L1_CACHE_BYTES))); u16 hw_tx_cons; + struct bnx2_napi bnx2_napi; + #ifdef BCM_VLAN struct vlan_group *vlgrp; #endif @@ -6672,6 +6677,7 @@ struct bnx2 { u32 stats_ticks; + struct status_block *status_blk; dma_addr_t status_blk_mapping; struct statistics_block *stats_blk; -- cgit v1.2.3 From a550c99bc39caf292ed214c0c9c2c4d0b9c95161 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 20 Dec 2007 19:56:59 -0800 Subject: [BNX2]: Move tx indexes into bnx2_napi struct. Tx related fields used in NAPI polling are moved from the main bnx2 struct to the bnx2_napi struct. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 345b6db9a94..958fdda09c6 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6509,6 +6509,9 @@ struct bnx2_napi { struct status_block *status_blk; u32 last_status_idx; u32 int_num; + + u16 tx_cons; + u16 hw_tx_cons; }; struct bnx2 { @@ -6539,9 +6542,6 @@ struct bnx2 { u32 tx_bidx_addr; u32 tx_bseq_addr; - u16 tx_cons __attribute__((aligned(L1_CACHE_BYTES))); - u16 hw_tx_cons; - struct bnx2_napi bnx2_napi; #ifdef BCM_VLAN -- cgit v1.2.3 From a1f6019090f2c075b41624c32a825775f6865577 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 20 Dec 2007 19:57:19 -0800 Subject: [BNX2]: Move rx indexes into bnx2_napi struct. Rx related fields used in NAPI polling are moved from the main bnx2 struct to the bnx2_napi struct. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 958fdda09c6..b75795b4f8c 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6512,6 +6512,14 @@ struct bnx2_napi { u16 tx_cons; u16 hw_tx_cons; + + u32 rx_prod_bseq; + u16 rx_prod; + u16 rx_cons; + + u16 rx_pg_prod; + u16 rx_pg_cons; + }; struct bnx2 { @@ -6556,13 +6564,6 @@ struct bnx2 { u32 rx_max_ring_idx; u32 rx_max_pg_ring_idx; - u32 rx_prod_bseq; - u16 rx_prod; - u16 rx_cons; - - u16 rx_pg_prod; - u16 rx_pg_cons; - u32 rx_csum; struct sw_bd *rx_buf_ring; -- cgit v1.2.3 From b4b360420dcbbffb15f5749fc78225f4113cc7e2 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 20 Dec 2007 19:59:30 -0800 Subject: [BNX2]: Support multiple MSIX IRQs. Change bnx2_napi struct into an array and add code to manage multiple IRQs. MSIX hardware structures and new registers are also added. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index b75795b4f8c..d71ceb6c176 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -154,6 +154,33 @@ struct status_block { #endif }; +/* + * status_block definition + */ +struct status_block_msix { +#if defined(__BIG_ENDIAN) + u16 status_tx_quick_consumer_index; + u16 status_rx_quick_consumer_index; + u16 status_completion_producer_index; + u16 status_cmd_consumer_index; + u32 status_unused; + u16 status_idx; + u8 status_unused2; + u8 status_blk_num; +#elif defined(__LITTLE_ENDIAN) + u16 status_rx_quick_consumer_index; + u16 status_tx_quick_consumer_index; + u16 status_cmd_consumer_index; + u16 status_completion_producer_index; + u32 status_unused; + u8 status_blk_num; + u8 status_unused2; + u16 status_idx; +#endif +}; + +#define BNX2_SBLK_MSIX_ALIGN_SIZE 128 + /* * statistics_block definition @@ -413,6 +440,7 @@ struct l2_fhdr { #define BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM (1L<<17) #define BNX2_PCICFG_INT_ACK_CMD_MASK_INT (1L<<18) #define BNX2_PCICFG_INT_ACK_CMD_INTERRUPT_NUM (0xfL<<24) +#define BNX2_PCICFG_INT_ACK_CMD_INT_NUM_SHIFT 24 #define BNX2_PCICFG_STATUS_BIT_SET_CMD 0x00000088 #define BNX2_PCICFG_STATUS_BIT_CLEAR_CMD 0x0000008c @@ -428,6 +456,9 @@ struct l2_fhdr { #define BNX2_PCI_GRC_WINDOW_ADDR_VALUE (0x1ffL<<13) #define BNX2_PCI_GRC_WINDOW_ADDR_SEP_WIN (1L<<31) +#define BNX2_PCI_GRC_WINDOW2_BASE 0xc000 +#define BNX2_PCI_GRC_WINDOW3_BASE 0xe000 + #define BNX2_PCI_CONFIG_1 0x00000404 #define BNX2_PCI_CONFIG_1_RESERVED0 (0xffL<<0) #define BNX2_PCI_CONFIG_1_READ_BOUNDARY (0x7L<<8) @@ -700,6 +731,8 @@ struct l2_fhdr { #define BNX2_PCI_GRC_WINDOW3_ADDR 0x00000618 #define BNX2_PCI_GRC_WINDOW3_ADDR_VALUE (0x1ffL<<13) +#define BNX2_MSIX_TABLE_ADDR 0x318000 +#define BNX2_MSIX_PBA_ADDR 0x31c000 /* * misc_reg definition @@ -6500,6 +6533,7 @@ struct flash_spec { struct bnx2_irq { irq_handler_t handler; u16 vector; + u8 requested; char name[16]; }; @@ -6535,13 +6569,15 @@ struct bnx2 { u32 flags; #define PCIX_FLAG 0x00000001 #define PCI_32BIT_FLAG 0x00000002 -#define ONE_TDMA_FLAG 0x00000004 /* no longer used */ +#define MSIX_CAP_FLAG 0x00000004 #define NO_WOL_FLAG 0x00000008 #define USING_MSI_FLAG 0x00000020 #define ASF_ENABLE_FLAG 0x00000040 #define MSI_CAP_FLAG 0x00000080 #define ONE_SHOT_MSI_FLAG 0x00000100 #define PCIE_FLAG 0x00000200 +#define USING_MSIX_FLAG 0x00000400 +#define USING_MSI_OR_MSIX_FLAG (USING_MSI_FLAG | USING_MSIX_FLAG) /* Put tx producer and consumer fields in separate cache lines. */ @@ -6550,7 +6586,7 @@ struct bnx2 { u32 tx_bidx_addr; u32 tx_bseq_addr; - struct bnx2_napi bnx2_napi; + struct bnx2_napi bnx2_napi[BNX2_MAX_MSIX_VEC]; #ifdef BCM_VLAN struct vlan_group *vlgrp; -- cgit v1.2.3 From c76c04758b8fd24a1c38b19742e3437e954e945b Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 20 Dec 2007 20:01:19 -0800 Subject: [BNX2]: Add support for a new tx ring. To separate TX IRQs into a different MSIX vector, we need to support a new tx ring. The original tx ring will still be used when not using MSIX. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index d71ceb6c176..68fb5904f75 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6529,6 +6529,9 @@ struct flash_spec { #define BNX2_MAX_MSIX_HW_VEC 9 #define BNX2_MAX_MSIX_VEC 1 +#define BNX2_BASE_VEC 0 +#define BNX2_TX_VEC 1 +#define BNX2_TX_INT_NUM (BNX2_TX_VEC << BNX2_PCICFG_INT_ACK_CMD_INT_NUM_SHIFT) struct bnx2_irq { irq_handler_t handler; @@ -6541,6 +6544,7 @@ struct bnx2_napi { struct napi_struct napi ____cacheline_aligned; struct bnx2 *bp; struct status_block *status_blk; + struct status_block_msix *status_blk_msix; u32 last_status_idx; u32 int_num; @@ -6583,6 +6587,7 @@ struct bnx2 { u32 tx_prod_bseq __attribute__((aligned(L1_CACHE_BYTES))); u16 tx_prod; + u8 tx_vec; u32 tx_bidx_addr; u32 tx_bseq_addr; -- cgit v1.2.3 From 57851d84533655db6948e25c54df19ecb673bf2f Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 20 Dec 2007 20:01:44 -0800 Subject: [BNX2]: Enable new tx ring. Enable new tx ring and add new MSIX handler and NAPI poll function for the new tx ring. Enable MSIX when the hardware supports it. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 68fb5904f75..09bd665a3b9 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6528,7 +6528,7 @@ struct flash_spec { }; #define BNX2_MAX_MSIX_HW_VEC 9 -#define BNX2_MAX_MSIX_VEC 1 +#define BNX2_MAX_MSIX_VEC 2 #define BNX2_BASE_VEC 0 #define BNX2_TX_VEC 1 #define BNX2_TX_INT_NUM (BNX2_TX_VEC << BNX2_PCICFG_INT_ACK_CMD_INT_NUM_SHIFT) -- cgit v1.2.3 From 2dd201d7b735f252df1a915a3f2e6a71910a3d87 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Mon, 21 Jan 2008 17:06:09 -0800 Subject: [BNX2]: Disable jumbo rx paging on 5709 Ax. The chip has problem running in this mode and needs to be disabled. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 09bd665a3b9..c1ab30b0f87 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6582,6 +6582,7 @@ struct bnx2 { #define PCIE_FLAG 0x00000200 #define USING_MSIX_FLAG 0x00000400 #define USING_MSI_OR_MSIX_FLAG (USING_MSI_FLAG | USING_MSIX_FLAG) +#define JUMBO_BROKEN_FLAG 0x00000800 /* Put tx producer and consumer fields in separate cache lines. */ -- cgit v1.2.3 From b2fadeae1334008c1bb4d87bc507141cb7aaf0e8 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Mon, 21 Jan 2008 17:07:06 -0800 Subject: [BNX2]: Add link-down workaround on 5706 serdes. In some blade systems using the 5706 serdes, the hardware sometimes does not properly generate link down interrupts. We add a workaround in the driver's timer to force a link-down when some PHY registers report loss of SYNC. The parallel detect logic is cleaned up slightly to better integrate the workaround. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index c1ab30b0f87..31a030a6e2a 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6344,6 +6344,15 @@ struct l2_fhdr { #define MII_BNX2_DSP_RW_PORT 0x15 #define MII_BNX2_DSP_ADDRESS 0x17 #define MII_BNX2_DSP_EXPAND_REG 0x0f00 +#define MII_EXPAND_REG1 (MII_BNX2_DSP_EXPAND_REG | 1) +#define MII_EXPAND_REG1_RUDI_C 0x20 +#define MII_EXPAND_SERDES_CTL (MII_BNX2_DSP_EXPAND_REG | 2) + +#define MII_BNX2_MISC_SHADOW 0x1c +#define MISC_SHDW_AN_DBG 0x6800 +#define MISC_SHDW_AN_DBG_NOSYNC 0x0002 +#define MISC_SHDW_MODE_CTL 0x7c00 +#define MISC_SHDW_MODE_CTL_SIG_DET 0x0010 #define MII_BNX2_BLK_ADDR 0x1f #define MII_BNX2_BLK_ADDR_IEEE0 0x0000 @@ -6643,6 +6652,7 @@ struct bnx2 { #define PHY_INT_MODE_LINK_READY_FLAG 0x200 #define PHY_DIS_EARLY_DAC_FLAG 0x400 #define REMOTE_PHY_CAP_FLAG 0x800 +#define PHY_FORCED_DOWN_FLAG 0x1000 u32 mii_bmcr; u32 mii_bmsr; -- cgit v1.2.3 From f86e82fb547efe05457391df069cce7ab530b181 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 21 Jan 2008 17:15:40 -0800 Subject: [BNX2]: Fix driver software flag namespace. Prefix "bnx2->flags" names with BNX2_* for consistency. Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 31a030a6e2a..cd79b5cb01a 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6580,18 +6580,19 @@ struct bnx2 { atomic_t intr_sem; u32 flags; -#define PCIX_FLAG 0x00000001 -#define PCI_32BIT_FLAG 0x00000002 -#define MSIX_CAP_FLAG 0x00000004 -#define NO_WOL_FLAG 0x00000008 -#define USING_MSI_FLAG 0x00000020 -#define ASF_ENABLE_FLAG 0x00000040 -#define MSI_CAP_FLAG 0x00000080 -#define ONE_SHOT_MSI_FLAG 0x00000100 -#define PCIE_FLAG 0x00000200 -#define USING_MSIX_FLAG 0x00000400 -#define USING_MSI_OR_MSIX_FLAG (USING_MSI_FLAG | USING_MSIX_FLAG) -#define JUMBO_BROKEN_FLAG 0x00000800 +#define BNX2_FLAG_PCIX 0x00000001 +#define BNX2_FLAG_PCI_32BIT 0x00000002 +#define BNX2_FLAG_MSIX_CAP 0x00000004 +#define BNX2_FLAG_NO_WOL 0x00000008 +#define BNX2_FLAG_USING_MSI 0x00000020 +#define BNX2_FLAG_ASF_ENABLE 0x00000040 +#define BNX2_FLAG_MSI_CAP 0x00000080 +#define BNX2_FLAG_ONE_SHOT_MSI 0x00000100 +#define BNX2_FLAG_PCIE 0x00000200 +#define BNX2_FLAG_USING_MSIX 0x00000400 +#define BNX2_FLAG_USING_MSI_OR_MSIX (BNX2_FLAG_USING_MSI | \ + BNX2_FLAG_USING_MSIX) +#define BNX2_FLAG_JUMBO_BROKEN 0x00000800 /* Put tx producer and consumer fields in separate cache lines. */ -- cgit v1.2.3 From 583c28e5645c464b57b4f5d3d53113c06bb0ac5f Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Mon, 21 Jan 2008 19:51:35 -0800 Subject: [BNX2]: Fix driver phy_flags name space. Prefix "bp->phy_flags" names with BNX2_PHY_FLAG_* for consistency. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index cd79b5cb01a..54ce11afd9f 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6644,16 +6644,16 @@ struct bnx2 { spinlock_t indirect_lock; u32 phy_flags; -#define PHY_SERDES_FLAG 1 -#define PHY_CRC_FIX_FLAG 2 -#define PHY_PARALLEL_DETECT_FLAG 4 -#define PHY_2_5G_CAPABLE_FLAG 8 -#define PHY_INT_MODE_MASK_FLAG 0x300 -#define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100 -#define PHY_INT_MODE_LINK_READY_FLAG 0x200 -#define PHY_DIS_EARLY_DAC_FLAG 0x400 -#define REMOTE_PHY_CAP_FLAG 0x800 -#define PHY_FORCED_DOWN_FLAG 0x1000 +#define BNX2_PHY_FLAG_SERDES 0x00000001 +#define BNX2_PHY_FLAG_CRC_FIX 0x00000002 +#define BNX2_PHY_FLAG_PARALLEL_DETECT 0x00000004 +#define BNX2_PHY_FLAG_2_5G_CAPABLE 0x00000008 +#define BNX2_PHY_FLAG_INT_MODE_MASK 0x00000300 +#define BNX2_PHY_FLAG_INT_MODE_AUTO_POLLING 0x00000100 +#define BNX2_PHY_FLAG_INT_MODE_LINK_READY 0x00000200 +#define BNX2_PHY_FLAG_DIS_EARLY_DAC 0x00000400 +#define BNX2_PHY_FLAG_REMOTE_PHY_CAP 0x00000800 +#define BNX2_PHY_FLAG_FORCED_DOWN 0x00001000 u32 mii_bmcr; u32 mii_bmsr; -- cgit v1.2.3 From b491edd5817f1618f4e06d67638739591a714bdb Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 22 Dec 2007 19:44:51 +0000 Subject: bnx2 annotations Signed-off-by: Al Viro Signed-off-by: Jeff Garzik --- drivers/net/bnx2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/bnx2.h') diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 54ce11afd9f..d8e034700c3 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -6850,7 +6850,7 @@ struct fw_info { const u32 text_addr; const u32 text_len; const u32 text_index; - u32 *text; + __le32 *text; u8 *gz_text; const u32 gz_text_len; -- cgit v1.2.3