aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge/qlge_main.c
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-01-04 20:08:11 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-04 20:08:11 -0500
commit459caf5a99cd066598192a86f8f63d73f0b423a6 (patch)
tree6e8e7fd06f3e46c540eff2a25a89abc1a219ecd3 /drivers/net/qlge/qlge_main.c
parent2b72c7849f9a091c1e5d7255732faf14ac7d5123 (diff)
qlge: bugfix: Fix ring length setting for rx ring, large/small
The length field for these rings is 16-bits. If the length is the max supported 65536 then the setting should be zero. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge_main.c')
-rw-r--r--drivers/net/qlge/qlge_main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index c0e43c552d1f..ffa210074424 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -2491,7 +2491,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
2491 memset((void *)cqicb, 0, sizeof(struct cqicb)); 2491 memset((void *)cqicb, 0, sizeof(struct cqicb));
2492 cqicb->msix_vect = rx_ring->irq; 2492 cqicb->msix_vect = rx_ring->irq;
2493 2493
2494 cqicb->len = cpu_to_le16(rx_ring->cq_len | LEN_V | LEN_CPP_CONT); 2494 bq_len = (rx_ring->cq_len == 65536) ? 0 : (u16) rx_ring->cq_len;
2495 cqicb->len = cpu_to_le16(bq_len | LEN_V | LEN_CPP_CONT);
2495 2496
2496 cqicb->addr_lo = cpu_to_le32(rx_ring->cq_base_dma); 2497 cqicb->addr_lo = cpu_to_le32(rx_ring->cq_base_dma);
2497 cqicb->addr_hi = cpu_to_le32((u64) rx_ring->cq_base_dma >> 32); 2498 cqicb->addr_hi = cpu_to_le32((u64) rx_ring->cq_base_dma >> 32);
@@ -2513,8 +2514,11 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
2513 cpu_to_le32(rx_ring->lbq_base_indirect_dma); 2514 cpu_to_le32(rx_ring->lbq_base_indirect_dma);
2514 cqicb->lbq_addr_hi = 2515 cqicb->lbq_addr_hi =
2515 cpu_to_le32((u64) rx_ring->lbq_base_indirect_dma >> 32); 2516 cpu_to_le32((u64) rx_ring->lbq_base_indirect_dma >> 32);
2516 cqicb->lbq_buf_size = cpu_to_le32(rx_ring->lbq_buf_size); 2517 bq_len = (rx_ring->lbq_buf_size == 65536) ? 0 :
2517 bq_len = (u16) rx_ring->lbq_len; 2518 (u16) rx_ring->lbq_buf_size;
2519 cqicb->lbq_buf_size = cpu_to_le16(bq_len);
2520 bq_len = (rx_ring->lbq_len == 65536) ? 0 :
2521 (u16) rx_ring->lbq_len;
2518 cqicb->lbq_len = cpu_to_le16(bq_len); 2522 cqicb->lbq_len = cpu_to_le16(bq_len);
2519 rx_ring->lbq_prod_idx = rx_ring->lbq_len - 16; 2523 rx_ring->lbq_prod_idx = rx_ring->lbq_len - 16;
2520 rx_ring->lbq_curr_idx = 0; 2524 rx_ring->lbq_curr_idx = 0;
@@ -2530,7 +2534,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
2530 cpu_to_le32((u64) rx_ring->sbq_base_indirect_dma >> 32); 2534 cpu_to_le32((u64) rx_ring->sbq_base_indirect_dma >> 32);
2531 cqicb->sbq_buf_size = 2535 cqicb->sbq_buf_size =
2532 cpu_to_le16(((rx_ring->sbq_buf_size / 2) + 8) & 0xfffffff8); 2536 cpu_to_le16(((rx_ring->sbq_buf_size / 2) + 8) & 0xfffffff8);
2533 bq_len = (u16) rx_ring->sbq_len; 2537 bq_len = (rx_ring->sbq_len == 65536) ? 0 :
2538 (u16) rx_ring->sbq_len;
2534 cqicb->sbq_len = cpu_to_le16(bq_len); 2539 cqicb->sbq_len = cpu_to_le16(bq_len);
2535 rx_ring->sbq_prod_idx = rx_ring->sbq_len - 16; 2540 rx_ring->sbq_prod_idx = rx_ring->sbq_len - 16;
2536 rx_ring->sbq_curr_idx = 0; 2541 rx_ring->sbq_curr_idx = 0;