Skip to content

Commit

Permalink
net: dsa: microchip: dcb: add comments for DSCP related functions
Browse files Browse the repository at this point in the history
All other functions are commented. Add missing comments to following
functions:
ksz_set_global_dscp_entry()
ksz_port_add_dscp_prio()
ksz_port_del_dscp_prio()

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240510053828.2412516-3-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Oleksij Rempel authored and Jakub Kicinski committed May 13, 2024
1 parent 2ccb1ac commit 593d6ad
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions drivers/net/dsa/microchip/ksz_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,17 @@ int ksz_port_get_dscp_prio(struct dsa_switch *ds, int port, u8 dscp)
return (data >> shift) & mask;
}

/**
* ksz_set_global_dscp_entry - Sets the global DSCP-to-priority mapping entry
* @dev: Pointer to the KSZ switch device structure
* @dscp: DSCP value for which to set the priority
* @ipm: Priority value to set
*
* This function sets the global DSCP-to-priority mapping entry for the
* specified DSCP value.
*
* Return: 0 on success, or a negative error code on failure.
*/
static int ksz_set_global_dscp_entry(struct ksz_device *dev, u8 dscp, u8 ipm)
{
int reg, per_reg, shift;
Expand Down Expand Up @@ -377,6 +388,16 @@ static int ksz_init_global_dscp_map(struct ksz_device *dev)
return 0;
}

/**
* ksz_port_add_dscp_prio - Adds a DSCP-to-priority mapping entry for a port on
* a KSZ switch.
* @ds: Pointer to the DSA switch structure
* @port: Port number for which to add the DSCP-to-priority mapping entry
* @dscp: DSCP value for which to add the priority
* @prio: Priority value to set
*
* Return: 0 on success, or a negative error code on failure
*/
int ksz_port_add_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, u8 prio)
{
struct ksz_device *dev = ds->priv;
Expand All @@ -387,6 +408,16 @@ int ksz_port_add_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, u8 prio)
return ksz_set_global_dscp_entry(dev, dscp, prio);
}

/**
* ksz_port_del_dscp_prio - Deletes a DSCP-to-priority mapping entry for a port
* on a KSZ switch.
* @ds: Pointer to the DSA switch structure
* @port: Port number for which to delete the DSCP-to-priority mapping entry
* @dscp: DSCP value for which to delete the priority
* @prio: Priority value to delete
*
* Return: 0 on success, or a negative error code on failure
*/
int ksz_port_del_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, u8 prio)
{
struct ksz_device *dev = ds->priv;
Expand Down

0 comments on commit 593d6ad

Please sign in to comment.