Re: [PATCH v3 09/11] can: lin: Handle rx offload config frames

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

 



On Mon, 2024-05-06 at 20:11 +0300, Ilpo Järvinen wrote:
> On Thu, 2 May 2024, Christoph Fritz wrote:
> 
> > The CAN Broadcast Manager now has the capability to dispatch CANFD
> > frames marked with the id LINBUS_RXOFFLOAD_ID. This patch introduces
> > functionality to interpret these specific frames, enabling the
> > configuration of RX offloading within the LIN driver.
> > 
> > Signed-off-by: Christoph Fritz <christoph.fritz@xxxxxxxxx>
> > ---
> >  drivers/net/can/lin.c | 29 +++++++++++++++++++++++++++++
> >  1 file changed, 29 insertions(+)
> > 
> > diff --git a/drivers/net/can/lin.c b/drivers/net/can/lin.c
> > index 95906003666fb..ee2ebea2c865f 100644
> > --- a/drivers/net/can/lin.c
> > +++ b/drivers/net/can/lin.c
> > @@ -194,6 +194,27 @@ static void lin_remove_sysfs_id_files(struct net_device *ndev)
> >  	}
> >  }
> >  
> > +static int lin_setup_rxoffload(struct lin_device *ldev,
> > +			       struct canfd_frame *cfd)
> > +{
> > +	struct lin_responder_answer answ;
> > +
> > +	if (!(cfd->flags & CANFD_FDF))
> > +		return -EMSGSIZE;
> 
> This seems a bit odd error code.

OK, will be changed in v4 to more common -EINVAL.

> 
> > +	BUILD_BUG_ON(sizeof(struct lin_responder_answer) > sizeof(cfd->data));
> > +	memcpy(&answ, cfd->data, sizeof(struct lin_responder_answer));
> 
> 2x sizeof(answ)

OK

...

thanks
  -- Christoph





[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux