diff options
author | Mandy Lavi <mandy.lavi@freescale.com> | 2015-03-15 14:42:46 (GMT) |
---|---|---|
committer | Honghua Yin <Hong-Hua.Yin@freescale.com> | 2015-03-25 08:16:18 (GMT) |
commit | 1aa49383a4e16ce0c98c73cf81e1a9b2938e68fc (patch) | |
tree | e936c42e02f34a15d85eda583a7b21a674bb3399 /drivers/net/ethernet/freescale/fman/src/wrapper | |
parent | b031f42ca8151800ac26e1c15d9ebe25954df24e (diff) | |
download | linux-fsl-qoriq-1aa49383a4e16ce0c98c73cf81e1a9b2938e68fc.tar.xz |
fmd: Add support for reading BMI counters from US
Technical Details : Add support for the following BMI counters
and make them available to the DPA stats interface in the
User Space:
e_FM_PORT_COUNTERS_DISCARD_FRAME,
/* BMI stat counter */
e_FM_PORT_COUNTERS_RX_BAD_FRAME,
/* BMI Rx stat counter */
e_FM_PORT_COUNTERS_RX_LARGE_FRAME,
/* BMI Rx stat counter */
e_FM_PORT_COUNTERS_RX_LIST_DMA_ERR,
/* BMI Rx OP stat counter */
e_FM_PORT_COUNTERS_RX_OUT_OF_BUFFERS_DISCARD,
/* BMI Rx OP stat counter */
e_FM_PORT_COUNTERS_WRED_DISCARD,
/* BMI OP stat counter */
@Function FM_PORT_GetBmiCounters
@Description Read port's BMI stat counters and place them into
a designated structure of counters.
@Param[in] h_FmPort A handle to a FM Port module.
@Param[out] p_BmiStats counters structure
Change-Id: I464b5defc29e149252002c911b22e69343e61adf
Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/32755
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Igal Liberman <Igal.Liberman@freescale.com>
Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman/src/wrapper')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c index ffa1a2d..109dd36 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c @@ -3550,7 +3550,7 @@ t_Error LnxwrpFmPortIOCTL(t_LnxWrpFmPortDev *p_LnxWrpFmPortDev, unsigned int cmd t_Error err = E_OK; _fm_ioctl_dbg("cmd:0x%08x(type:0x%02x, nr:%u).\n", - cmd, _IOC_TYPE(cmd), _IOC_NR(cmd) - 50); + cmd, _IOC_TYPE(cmd), _IOC_NR(cmd) - 70); switch (cmd) { @@ -4475,6 +4475,27 @@ t_Error LnxwrpFmPortIOCTL(t_LnxWrpFmPortDev *p_LnxWrpFmPortDev, unsigned int cmd break; } + case FM_PORT_IOC_GET_BMI_COUNTERS: + { + t_LnxWrpFmDev *p_LnxWrpFmDev = + (t_LnxWrpFmDev *)p_LnxWrpFmPortDev->h_LnxWrpFmDev; + ioc_fm_port_bmi_stats_t param; + int port_id = p_LnxWrpFmPortDev->id; + + if (!p_LnxWrpFmDev) + RETURN_ERROR(MINOR, E_NOT_AVAILABLE, ("Port not initialized or other error!")); + + if (FM_PORT_GetBmiCounters(p_LnxWrpFmPortDev->h_Dev, + (t_FmPortBmiStats *)¶m)) + RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG); + + if (copy_to_user((ioc_fm_port_bmi_stats_t *)arg, ¶m, + sizeof(ioc_fm_port_bmi_stats_t))) + RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG); + + break; + } + default: RETURN_ERROR(MINOR, E_INVALID_SELECTION, ("invalid ioctl: cmd:0x%08x(type:0x%02x, nr:0x%02x.\n", |