Commit b010bf72 authored by Kory Maincent (Dent Project)'s avatar Kory Maincent (Dent Project) Committed by Jakub Kicinski
Browse files

net: pse-pd: Rectify and adapt the naming of admin_cotrol member of struct pse_control_config



In commit 18ff0bcd ("ethtool: add interface to interact with Ethernet
Power Equipment"), the 'pse_control_config' structure was introduced,
housing a single member labeled 'admin_cotrol' responsible for maintaining
the operational state of the PoDL PSE functions.

A noticeable typographical error exists in the naming of this field
('cotrol' should be corrected to 'control'), which this commit aims to
rectify.

Furthermore, with upcoming extensions of this structure to encompass PoE
functionalities, the field is being renamed to 'podl_admin_state' to
distinctly indicate that this state is tailored specifically for PoDL."

Reviewed-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarKory Maincent <kory.maincent@bootlin.com>
Link: https://lore.kernel.org/r/20240414-feature_poe-v8-3-e4bf1e860da5@bootlin.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 93c0d8c0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -31,10 +31,10 @@ pse_reg_ethtool_set_config(struct pse_controller_dev *pcdev, unsigned long id,
	struct pse_reg_priv *priv = to_pse_reg(pcdev);
	int ret;

	if (priv->admin_state == config->admin_cotrol)
	if (priv->admin_state == config->podl_admin_control)
		return 0;

	switch (config->admin_cotrol) {
	switch (config->podl_admin_control) {
	case ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED:
		ret = regulator_enable(priv->ps);
		break;
@@ -43,14 +43,14 @@ pse_reg_ethtool_set_config(struct pse_controller_dev *pcdev, unsigned long id,
		break;
	default:
		dev_err(pcdev->dev, "Unknown admin state %i\n",
			config->admin_cotrol);
			config->podl_admin_control);
		ret = -ENOTSUPP;
	}

	if (ret)
		return ret;

	priv->admin_state = config->admin_cotrol;
	priv->admin_state = config->podl_admin_control;

	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -15,11 +15,11 @@ struct pse_controller_dev;
/**
 * struct pse_control_config - PSE control/channel configuration.
 *
 * @admin_cotrol: set PoDL PSE admin control as described in
 * @podl_admin_control: set PoDL PSE admin control as described in
 *	IEEE 802.3-2018 30.15.1.2.1 acPoDLPSEAdminControl
 */
struct pse_control_config {
	enum ethtool_podl_pse_admin_state admin_cotrol;
	enum ethtool_podl_pse_admin_state podl_admin_control;
};

/**
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ ethnl_set_pse(struct ethnl_req_info *req_info, struct genl_info *info)
	struct phy_device *phydev;

	/* this values are already validated by the ethnl_pse_set_policy */
	config.admin_cotrol = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]);
	config.podl_admin_control = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]);

	phydev = dev->phydev;
	if (!phydev) {