diff options
author | Navdeep Parhar <np@FreeBSD.org> | 2021-02-26 02:10:52 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2021-04-26 19:01:10 +0000 |
commit | cc76018cdd89880eea505b02ebd1d01cec247afb (patch) | |
tree | a33c7c3c759515a388a9138d408e75c87a04ff79 /sys/dev/cxgbe/common/t4_hw.c | |
parent | 8130bdab382da6af59c94d456f2c26f56d86d9d1 (diff) |
cxgbe(4): Read the rx 'c' channel for a port and make it available.
Sponsored by: Chelsio Communications
(cherry picked from commit dfff1de729bd73004404863b7f9e8a9bda7b0f04)
Diffstat (limited to 'sys/dev/cxgbe/common/t4_hw.c')
-rw-r--r-- | sys/dev/cxgbe/common/t4_hw.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index b54a71a02ca4..734ab7f33acb 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -6818,6 +6818,23 @@ static unsigned int t4_get_rx_e_chan_map(struct adapter *adap, int idx) return 1 << idx; } +/* + * TP RX c-channel associated with the port. + */ +static unsigned int t4_get_rx_c_chan(struct adapter *adap, int idx) +{ + u32 param, val; + int ret; + + param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_TPCHMAP)); + ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, ¶m, &val); + if (!ret) + return (val >> (8 * idx)) & 0xff; + + return 0; +} + /** * t4_get_port_type_description - return Port Type string description * @port_type: firmware Port Type enumeration @@ -9789,6 +9806,7 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id) p->tx_chan = j; p->mps_bg_map = t4_get_mps_bg_map(adap, j); p->rx_e_chan_map = t4_get_rx_e_chan_map(adap, j); + p->rx_c_chan = t4_get_rx_c_chan(adap, j); p->lport = j; if (!(adap->flags & IS_VF) || |