aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/sge.c
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-12-17 21:47:31 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:22 -0500
commitb881955b7d045e7486e9af08398242aeb7199f67 (patch)
treefadf96f161a8a03bd285c4b63140407ab5f527d9 /drivers/net/cxgb3/sge.c
parent06daa168b681797c91ce1fd567d706b9b84738e2 (diff)
cxgb3 - parity initialization for T3C adapters.
Add parity initialization for T3C adapters. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3/sge.c')
-rw-r--r--drivers/net/cxgb3/sge.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 666c317dc6d6..cef153d1d32c 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -2443,6 +2443,15 @@ irq_handler_t t3_intr_handler(struct adapter *adap, int polling)
2443 return t3_intr; 2443 return t3_intr;
2444} 2444}
2445 2445
2446#define SGE_PARERR (F_CPPARITYERROR | F_OCPARITYERROR | F_RCPARITYERROR | \
2447 F_IRPARITYERROR | V_ITPARITYERROR(M_ITPARITYERROR) | \
2448 V_FLPARITYERROR(M_FLPARITYERROR) | F_LODRBPARITYERROR | \
2449 F_HIDRBPARITYERROR | F_LORCQPARITYERROR | \
2450 F_HIRCQPARITYERROR)
2451#define SGE_FRAMINGERR (F_UC_REQ_FRAMINGERROR | F_R_REQ_FRAMINGERROR)
2452#define SGE_FATALERR (SGE_PARERR | SGE_FRAMINGERR | F_RSPQCREDITOVERFOW | \
2453 F_RSPQDISABLED)
2454
2446/** 2455/**
2447 * t3_sge_err_intr_handler - SGE async event interrupt handler 2456 * t3_sge_err_intr_handler - SGE async event interrupt handler
2448 * @adapter: the adapter 2457 * @adapter: the adapter
@@ -2453,6 +2462,13 @@ void t3_sge_err_intr_handler(struct adapter *adapter)
2453{ 2462{
2454 unsigned int v, status = t3_read_reg(adapter, A_SG_INT_CAUSE); 2463 unsigned int v, status = t3_read_reg(adapter, A_SG_INT_CAUSE);
2455 2464
2465 if (status & SGE_PARERR)
2466 CH_ALERT(adapter, "SGE parity error (0x%x)\n",
2467 status & SGE_PARERR);
2468 if (status & SGE_FRAMINGERR)
2469 CH_ALERT(adapter, "SGE framing error (0x%x)\n",
2470 status & SGE_FRAMINGERR);
2471
2456 if (status & F_RSPQCREDITOVERFOW) 2472 if (status & F_RSPQCREDITOVERFOW)
2457 CH_ALERT(adapter, "SGE response queue credit overflow\n"); 2473 CH_ALERT(adapter, "SGE response queue credit overflow\n");
2458 2474
@@ -2469,7 +2485,7 @@ void t3_sge_err_intr_handler(struct adapter *adapter)
2469 status & F_HIPIODRBDROPERR ? "high" : "lo"); 2485 status & F_HIPIODRBDROPERR ? "high" : "lo");
2470 2486
2471 t3_write_reg(adapter, A_SG_INT_CAUSE, status); 2487 t3_write_reg(adapter, A_SG_INT_CAUSE, status);
2472 if (status & (F_RSPQCREDITOVERFOW | F_RSPQDISABLED)) 2488 if (status & SGE_FATALERR)
2473 t3_fatal_err(adapter); 2489 t3_fatal_err(adapter);
2474} 2490}
2475 2491
@@ -2781,7 +2797,7 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
2781 unsigned int ctrl, ups = ffs(pci_resource_len(adap->pdev, 2) >> 12); 2797 unsigned int ctrl, ups = ffs(pci_resource_len(adap->pdev, 2) >> 12);
2782 2798
2783 ctrl = F_DROPPKT | V_PKTSHIFT(2) | F_FLMODE | F_AVOIDCQOVFL | 2799 ctrl = F_DROPPKT | V_PKTSHIFT(2) | F_FLMODE | F_AVOIDCQOVFL |
2784 F_CQCRDTCTRL | 2800 F_CQCRDTCTRL | F_CONGMODE | F_TNLFLMODE | F_FATLPERREN |
2785 V_HOSTPAGESIZE(PAGE_SHIFT - 11) | F_BIGENDIANINGRESS | 2801 V_HOSTPAGESIZE(PAGE_SHIFT - 11) | F_BIGENDIANINGRESS |
2786 V_USERSPACESIZE(ups ? ups - 1 : 0) | F_ISCSICOALESCING; 2802 V_USERSPACESIZE(ups ? ups - 1 : 0) | F_ISCSICOALESCING;
2787#if SGE_NUM_GENBITS == 1 2803#if SGE_NUM_GENBITS == 1
@@ -2790,7 +2806,6 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
2790 if (adap->params.rev > 0) { 2806 if (adap->params.rev > 0) {
2791 if (!(adap->flags & (USING_MSIX | USING_MSI))) 2807 if (!(adap->flags & (USING_MSIX | USING_MSI)))
2792 ctrl |= F_ONEINTMULTQ | F_OPTONEINTMULTQ; 2808 ctrl |= F_ONEINTMULTQ | F_OPTONEINTMULTQ;
2793 ctrl |= F_CQCRDTCTRL | F_AVOIDCQOVFL;
2794 } 2809 }
2795 t3_write_reg(adap, A_SG_CONTROL, ctrl); 2810 t3_write_reg(adap, A_SG_CONTROL, ctrl);
2796 t3_write_reg(adap, A_SG_EGR_RCQ_DRB_THRSH, V_HIRCQDRBTHRSH(512) | 2811 t3_write_reg(adap, A_SG_EGR_RCQ_DRB_THRSH, V_HIRCQDRBTHRSH(512) |
@@ -2798,7 +2813,8 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
2798 t3_write_reg(adap, A_SG_TIMER_TICK, core_ticks_per_usec(adap) / 10); 2813 t3_write_reg(adap, A_SG_TIMER_TICK, core_ticks_per_usec(adap) / 10);
2799 t3_write_reg(adap, A_SG_CMDQ_CREDIT_TH, V_THRESHOLD(32) | 2814 t3_write_reg(adap, A_SG_CMDQ_CREDIT_TH, V_THRESHOLD(32) |
2800 V_TIMEOUT(200 * core_ticks_per_usec(adap))); 2815 V_TIMEOUT(200 * core_ticks_per_usec(adap)));
2801 t3_write_reg(adap, A_SG_HI_DRB_HI_THRSH, 1000); 2816 t3_write_reg(adap, A_SG_HI_DRB_HI_THRSH,
2817 adap->params.rev < T3_REV_C ? 1000 : 500);
2802 t3_write_reg(adap, A_SG_HI_DRB_LO_THRSH, 256); 2818 t3_write_reg(adap, A_SG_HI_DRB_LO_THRSH, 256);
2803 t3_write_reg(adap, A_SG_LO_DRB_HI_THRSH, 1000); 2819 t3_write_reg(adap, A_SG_LO_DRB_HI_THRSH, 1000);
2804 t3_write_reg(adap, A_SG_LO_DRB_LO_THRSH, 256); 2820 t3_write_reg(adap, A_SG_LO_DRB_LO_THRSH, 256);