Deleted Added
full compact
28c28
< __FBSDID("$FreeBSD: head/sys/dev/cxgbe/common/t4_hw.c 252747 2013-07-05 01:53:51Z np $");
---
> __FBSDID("$FreeBSD: head/sys/dev/cxgbe/common/t4_hw.c 253691 2013-07-26 22:04:11Z np $");
3627,3632c3627,3629
< * Configures one of the tracing filters available in HW. If @enable is
< * %0 @tp is not examined and may be %NULL. The user is responsible to
< * set the single/multiple trace mode by writing to A_MPS_TRC_CFG register
< * by using "cxgbtool iface reg reg_addr=val" command. See t4_sniffer/
< * docs/readme.txt for a complete description of how to setup traceing on
< * T4.
---
> * Configures one of the tracing filters available in HW. If @tp is %NULL
> * it indicates that the filter is already written in the register and it
> * just needs to be enabled or disabled.
3634,3635c3631,3632
< int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp, int idx,
< int enable)
---
> int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp,
> int idx, int enable)
3639a3637
> u32 en = is_t4(adap) ? F_TFEN : F_T5_TFEN;
3641,3642c3639,3644
< if (!enable) {
< t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, 0);
---
> if (idx < 0 || idx >= NTRACE)
> return -EINVAL;
>
> if (tp == NULL || !enable) {
> t4_set_reg_field(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, en,
> enable ? en : 0);
3663,3664c3665
< }
< else {
---
> } else {
3675,3676c3676,3678
< if (tp->port > 11 || tp->invert > 1 || tp->skip_len > M_TFLENGTH ||
< tp->skip_ofst > M_TFOFFSET || tp->min_len > M_TFMINPKTSIZE)
---
> if (tp->port > (is_t4(adap) ? 11 : 19) || tp->invert > 1 ||
> tp->skip_len > M_TFLENGTH || tp->skip_ofst > M_TFOFFSET ||
> tp->min_len > M_TFMINPKTSIZE)
3680c3682
< t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, 0);
---
> t4_set_reg_field(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, en, 0);
3694,3698c3696,3699
< V_TFOFFSET(tp->skip_ofst) | V_TFLENGTH(tp->skip_len) |
< is_t4(adap) ?
< V_TFPORT(tp->port) | F_TFEN | V_TFINVERTMATCH(tp->invert) :
< V_T5_TFPORT(tp->port) | F_T5_TFEN |
< V_T5_TFINVERTMATCH(tp->invert));
---
> V_TFOFFSET(tp->skip_ofst) | V_TFLENGTH(tp->skip_len) | en |
> (is_t4(adap) ?
> V_TFPORT(tp->port) | V_TFINVERTMATCH(tp->invert) :
> V_T5_TFPORT(tp->port) | V_T5_TFINVERTMATCH(tp->invert)));
3724a3726
> tp->invert = !!(ctla & F_TFINVERTMATCH);
3727a3730
> tp->invert = !!(ctla & F_T5_TFINVERTMATCH);
3733d3735
< tp->invert = !!(ctla & F_TFINVERTMATCH);