diff options
author | Sachin Saxena <sachin.saxena@freescale.com> | 2013-04-18 05:01:11 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-18 22:47:53 (GMT) |
commit | 06965e688911dca3b07ad4b852254d457e79a286 (patch) | |
tree | 3b4d9fcdef336a7614b25864a263630886eb8ced /drivers/net/ethernet/freescale/fman | |
parent | 9576d27c680ebc6e9e645088b8cc3b7d7fe69a91 (diff) | |
download | linux-fsl-qoriq-06965e688911dca3b07ad4b852254d457e79a286.tar.xz |
FMAN: Adding Wrapper API to use Rate Limiting Feature
- The API enables other module to Set / Delete Rate Limiting Feature on a given FMAN port.
Change-Id: I28f0bdfb9ca2b1c97df6dfcb2456bc3730cfd7d2
Signed-off-by: Sachin Saxena <sachin.saxena@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/1377
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/src/inc/wrapper/fsl_fman.h | 25 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c | 26 |
2 files changed, 51 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fman/src/inc/wrapper/fsl_fman.h b/drivers/net/ethernet/freescale/fman/src/inc/wrapper/fsl_fman.h index 3efc8ce..89d022b 100644 --- a/drivers/net/ethernet/freescale/fman/src/inc/wrapper/fsl_fman.h +++ b/drivers/net/ethernet/freescale/fman/src/inc/wrapper/fsl_fman.h @@ -315,6 +315,31 @@ int fm_get_max_frm(void); *//***************************************************************************/ int fm_get_rx_extra_headroom(void); +/**************************************************************************//** + @Function fm_port_set_rate_limit + + @Description Configure Shaper parameter on FM-port device (Tx port). + + @Param[in] port - A handle of the FM port device. + @Param[in] max_burst_size - Value of maximum burst size allowed. + @Param[in] rate_limit - The required rate value. + + @Cautions Allowed only after the port is initialized. +*//***************************************************************************/ +int fm_port_set_rate_limit(struct fm_port *port, + uint16_t max_burst_size, + uint32_t rate_limit); +/**************************************************************************//** + @Function fm_port_set_rate_limit + + @Description Delete Shaper configuration on FM-port device (Tx port). + + @Param[in] port - A handle of the FM port device. + + @Cautions Allowed only after the port is initialized. +*//***************************************************************************/ +int fm_port_del_rate_limit(struct fm_port *port); + /** @} */ /* end of FM_LnxKern_ctrl_grp group */ /** @} */ /* end of FM_LnxKern_grp group */ diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c index b20f3a5..a4f6166 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c @@ -1268,6 +1268,32 @@ void fm_port_disable(struct fm_port *port) } EXPORT_SYMBOL(fm_port_disable); +int fm_port_set_rate_limit(struct fm_port *port, + uint16_t max_burst_size, + uint32_t rate_limit) +{ + t_FmPortRateLimit param; + t_LnxWrpFmPortDev *p_LnxWrpFmPortDev = (t_LnxWrpFmPortDev *)port; + int err = 0; + + param.maxBurstSize = max_burst_size; + param.rateLimit = rate_limit; + param.rateLimitDivider = 0; + + err = FM_PORT_SetRateLimit(p_LnxWrpFmPortDev->h_Dev, ¶m); + return err; +} +EXPORT_SYMBOL(fm_port_set_rate_limit); + +int fm_port_del_rate_limit(struct fm_port *port) +{ + t_LnxWrpFmPortDev *p_LnxWrpFmPortDev = (t_LnxWrpFmPortDev *)port; + + FM_PORT_DeleteRateLimit(p_LnxWrpFmPortDev->h_Dev); + return 0; +} +EXPORT_SYMBOL(fm_port_del_rate_limit); + void fm_mutex_lock(void) { mutex_lock(&lnxwrp_mutex); |