/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (C) 2003-2005 Chelsio Communications. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI" /* tp.c */
#include "common.h"
#include "regs.h"
#include "tp.h"
#ifdef CONFIG_CHELSIO_T1_1G
#include "fpga_defs.h"
#endif
struct petp {
};
/* Pause deadlock avoidance parameters */
#ifdef CONFIG_CHELSIO_T1_OFFLOAD
{
return num;
}
{
if (p->pm_rx_num_pgs > num)
p->pm_rx_num_pgs = num;
if (p->pm_tx_num_pgs > num)
p->pm_tx_num_pgs = num;
}
{
}
{
}
{
}
{
/* Set Retransmission shift max */
/* Set DACK timer to 200ms */
}
{
if (size > TP_MAX_RX_COALESCING_SIZE)
return -EINVAL;
size = 9904;
if (size) {
/* Set coalescing size. */
V_RX_COALESCE_SIZE(size) | v);
} else
return 0;
}
{
int i;
}
#endif
unsigned int tp_clk)
{
if (t1_is_asic(ap)) {
if (!p->pm_size)
val |= F_OFFLOAD_DISABLE;
else
F_PATH_MTU /* IP DF bit */ |
V_SYN_COOKIE_PARAMETER(29));
/*
* Enable pause frame deadlock prevention.
*/
}
#ifdef CONFIG_CHELSIO_T1_OFFLOAD
/* We don't want timestamps for T204, otherwise we don't know
* the MSS.
*/
/* We do scheduling in software for T204, increase the cong.
* window to avoid TP holding on to payload longer than we
* expect.
*/
else
/*
* Calculate the time between modulation events, which affects
* both the Tx and Rx pipelines. Larger values force the Tx
* pipeline to wait before processing modulation events, thus
* allowing Rx to use the pipeline. A really small delay can
* starve the Rx side from accessing the pipeline.
*
* A balanced value is optimal. This is roughly 9us per 1G.
* The Tx needs a low delay time for handling a lot of small
* packets. Too big of a delay could cause Tx not to achieve
* line rate.
*/
/* adjust for multiple ports */
val = 0;
}
val /= 10;
/*
* Bit 0 must be 0 to keep the timer insertion property.
*/
/* PR3229 */
}
#ifdef CONFIG_CHELSIO_T1_1G
} else { /* FPGA */
#endif
#endif
}
}
{
}
{
if (!tp)
return NULL;
#ifdef CONFIG_CHELSIO_T1_OFFLOAD
if (p->pm_size) { /* Default PM partitioning */
#ifdef TDI_SUPPORT
#else
#endif
else
p->pm_rx_pg_size);
p->pm_tx_pg_size);
}
#endif
return tp;
}
{
#ifdef CONFIG_CHELSIO_T1_1G
/* FPGA */
0xffffffff);
} else
#endif
{
/* We don't use any TP interrupts */
tp_intr | F_PL_INTR_TP);
}
}
{
#ifdef CONFIG_CHELSIO_T1_1G
/* FPGA */
} else
#endif
{
tp_intr & ~F_PL_INTR_TP);
}
}
{
#ifdef CONFIG_CHELSIO_T1_1G
0xffffffff);
return;
}
#endif
}
{
#ifdef CONFIG_CHELSIO_T1_1G
/* FPGA doesn't support TP interrupts. */
return 1;
#endif
return 0;
}
{
if (enable)
else
}
{
}
{
}
{
}
/*
* Initialize TP state. tp_params contains initial settings for some TP
* parameters, particularly the one-time PM and CM settings.
*/
{
int busy = 0;
#ifdef CONFIG_CHELSIO_T1_OFFLOAD
if (p->pm_size) {
tp_pm_configure(adapter, p);
0, 1000, 5);
}
#endif
if (!busy)
else
CH_ERR("%s: TP initialization timed out\n",
return busy;
}