Thread (36 messages) 36 messages, 4 authors, 2025-03-26

Re: [PATCH net-next v6 08/12] net: pse-pd: pd692x0: Add support for PSE PI priority feature

flat view

From: Oleksij Rempel <o.rempel@pengutronix.de>
Date: 2025-03-17 13:20:26
Also in: linux-devicetree, linux-doc, lkml

On Tue, Mar 04, 2025 at 11:18:57AM +0100, Kory Maincent wrote:
quoted hunk ↗ jump to hunk
 static u8 pd692x0_build_msg(struct pd692x0_msg *msg, u8 echo)
@@ -739,6 +755,29 @@ pd692x0_pi_get_actual_pw(struct pse_controller_dev *pcdev, int id)
 	return (buf.data[0] << 4 | buf.data[1]) * 100;
 }
 
+static int
+pd692x0_pi_get_prio(struct pse_controller_dev *pcdev, int id)
+{
+	struct pd692x0_priv *priv = to_pd692x0_priv(pcdev);
+	struct pd692x0_msg msg, buf = {0};
+	int ret;
+
+	ret = pd692x0_fw_unavailable(priv);
+	if (ret)
+		return ret;
+
+	msg = pd692x0_msg_template_list[PD692X0_MSG_GET_PORT_PARAM];
+	msg.sub[2] = id;
+	ret = pd692x0_sendrecv_msg(priv, &msg, &buf);
+	if (ret < 0)
+		return ret;
+	if (buf.data[2] < 1 || 3 < buf.data[2])
if (!buf.data[2] || buf.data[2] > pcdev->pis_prio_max + 1)


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help