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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 17 Mar 2025 14:20:02 +0100
Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:

> On Tue, Mar 04, 2025 at 11:18:57AM +0100, Kory Maincent wrote:
> >  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)

Oh indeed that is better, thanks!

-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux