Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/cxgbe/common/t4_hw.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 9,608 Lines • ▼ Show 20 Lines | |||||
* t4_init_tp_params - initialize adap->params.tp | * t4_init_tp_params - initialize adap->params.tp | ||||
* @adap: the adapter | * @adap: the adapter | ||||
* | * | ||||
* Initialize various fields of the adapter's TP Parameters structure. | * Initialize various fields of the adapter's TP Parameters structure. | ||||
*/ | */ | ||||
int t4_init_tp_params(struct adapter *adap, bool sleep_ok) | int t4_init_tp_params(struct adapter *adap, bool sleep_ok) | ||||
{ | { | ||||
int chan; | int chan; | ||||
u32 v; | u32 tx_len, rx_len, r, v; | ||||
struct tp_params *tpp = &adap->params.tp; | struct tp_params *tpp = &adap->params.tp; | ||||
v = t4_read_reg(adap, A_TP_TIMER_RESOLUTION); | v = t4_read_reg(adap, A_TP_TIMER_RESOLUTION); | ||||
tpp->tre = G_TIMERRESOLUTION(v); | tpp->tre = G_TIMERRESOLUTION(v); | ||||
tpp->dack_re = G_DELAYEDACKRESOLUTION(v); | tpp->dack_re = G_DELAYEDACKRESOLUTION(v); | ||||
/* MODQ_REQ_MAP defaults to setting queues 0-3 to chan 0-3 */ | /* MODQ_REQ_MAP defaults to setting queues 0-3 to chan 0-3 */ | ||||
for (chan = 0; chan < MAX_NCHAN; chan++) | for (chan = 0; chan < MAX_NCHAN; chan++) | ||||
Show All 9 Lines | int t4_init_tp_params(struct adapter *adap, bool sleep_ok) | ||||
tpp->err_vec_mask = htobe16(0xffff); | tpp->err_vec_mask = htobe16(0xffff); | ||||
if (chip_id(adap) > CHELSIO_T5) { | if (chip_id(adap) > CHELSIO_T5) { | ||||
v = t4_read_reg(adap, A_TP_OUT_CONFIG); | v = t4_read_reg(adap, A_TP_OUT_CONFIG); | ||||
if (v & F_CRXPKTENC) { | if (v & F_CRXPKTENC) { | ||||
tpp->err_vec_mask = | tpp->err_vec_mask = | ||||
htobe16(V_T6_COMPR_RXERR_VEC(M_T6_COMPR_RXERR_VEC)); | htobe16(V_T6_COMPR_RXERR_VEC(M_T6_COMPR_RXERR_VEC)); | ||||
} | } | ||||
} | } | ||||
rx_len = t4_read_reg(adap, A_TP_PMM_RX_PAGE_SIZE); | |||||
tx_len = t4_read_reg(adap, A_TP_PMM_TX_PAGE_SIZE); | |||||
r = t4_read_reg(adap, A_TP_PARA_REG2); | |||||
rx_len = min(rx_len, G_MAXRXDATA(r)); | |||||
tx_len = min(tx_len, G_MAXRXDATA(r)); | |||||
r = t4_read_reg(adap, A_TP_PARA_REG7); | |||||
v = min(G_PMMAXXFERLEN0(r), G_PMMAXXFERLEN1(r)); | |||||
rx_len = min(rx_len, v); | |||||
tx_len = min(tx_len, v); | |||||
tpp->max_tx_pdu = tx_len; | |||||
tpp->max_rx_pdu = rx_len; | |||||
return 0; | return 0; | ||||
} | } | ||||
/** | /** | ||||
* t4_filter_field_shift - calculate filter field shift | * t4_filter_field_shift - calculate filter field shift | ||||
* @adap: the adapter | * @adap: the adapter | ||||
* @filter_sel: the desired field (from TP_VLAN_PRI_MAP bits) | * @filter_sel: the desired field (from TP_VLAN_PRI_MAP bits) | ||||
▲ Show 20 Lines • Show All 1,654 Lines • Show Last 20 Lines |