net/can: Add FAR specifier and fix nxstyle issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
parent
588a7241a8
commit
5bee23da07
@ -119,7 +119,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
if (pstate->pr_msglen > 0) /* concat cmsg data after packet */
|
if (pstate->pr_msglen > 0) /* concat cmsg data after packet */
|
||||||
{
|
{
|
||||||
memcpy(dev->d_buf + pstate->snd_buflen, pstate->pr_msgbuf,
|
memcpy(dev->d_buf + pstate->snd_buflen, pstate->pr_msgbuf,
|
||||||
pstate->pr_msglen);
|
pstate->pr_msglen);
|
||||||
dev->d_sndlen = pstate->snd_buflen + pstate->pr_msglen;
|
dev->d_sndlen = pstate->snd_buflen + pstate->pr_msglen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,8 +202,8 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
|
|||||||
#if defined(CONFIG_NET_CANPROTO_OPTIONS) && defined(CONFIG_NET_CAN_CANFD)
|
#if defined(CONFIG_NET_CANPROTO_OPTIONS) && defined(CONFIG_NET_CAN_CANFD)
|
||||||
if (conn->fd_frames)
|
if (conn->fd_frames)
|
||||||
{
|
{
|
||||||
if (msg->msg_iov->iov_len != CANFD_MTU
|
if (msg->msg_iov->iov_len != CANFD_MTU &&
|
||||||
&& msg->msg_iov->iov_len != CAN_MTU)
|
msg->msg_iov->iov_len != CAN_MTU)
|
||||||
{
|
{
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -233,10 +233,11 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
|
|||||||
#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
|
#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
|
||||||
if (msg->msg_controllen > sizeof(struct cmsghdr))
|
if (msg->msg_controllen > sizeof(struct cmsghdr))
|
||||||
{
|
{
|
||||||
struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
|
FAR struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
|
||||||
if (conn->tx_deadline && cmsg->cmsg_level == SOL_CAN_RAW
|
if (conn->tx_deadline &&
|
||||||
&& cmsg->cmsg_type == CAN_RAW_TX_DEADLINE
|
cmsg->cmsg_level == SOL_CAN_RAW &&
|
||||||
&& cmsg->cmsg_len == sizeof(struct timeval))
|
cmsg->cmsg_type == CAN_RAW_TX_DEADLINE &&
|
||||||
|
cmsg->cmsg_len == sizeof(struct timeval))
|
||||||
{
|
{
|
||||||
state.pr_msgbuf = CMSG_DATA(cmsg); /* Buffer to cmsg data */
|
state.pr_msgbuf = CMSG_DATA(cmsg); /* Buffer to cmsg data */
|
||||||
state.pr_msglen = cmsg->cmsg_len; /* len of cmsg data */
|
state.pr_msglen = cmsg->cmsg_len; /* len of cmsg data */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user