Fix buffer full test in generic CAN driver (plus fixes to comments)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4259 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
1121973925
commit
c3bf42b97b
@ -2333,4 +2333,12 @@
|
||||
performance.
|
||||
* confgs/olimex-lpc1766stk/nsh: Now supports the CAN loopback test as an
|
||||
optional "built-in" application.
|
||||
* sched/irq_attach.c: Fix an issue with disabling interrupts when they are
|
||||
detached. For the PIC32, this can't be done because there is a 1-to-many
|
||||
relationship between vector numbers and interrupt numbers or different.
|
||||
Added a new configuration option CONFIG_ARCH_VECNOTIRQ to at least flag
|
||||
the architectures that have this issue and to (at least) avoid doing
|
||||
something too wrong.
|
||||
* drivers/can.c: Fix a test for buffer full in the generic, "upper half",
|
||||
can driver.
|
||||
|
||||
|
9
TODO
9
TODO
@ -1,4 +1,4 @@
|
||||
NuttX TODO List (Last updated December 27, 2011)
|
||||
NuttX TODO List (Last updated January 3, 2012)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
||||
@ -1185,10 +1185,11 @@ o 8051 / MCS51 (arch/8051/)
|
||||
o MIPS (arch/mips)
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Title: PIC32MX PORT UNVERIFIED
|
||||
Description: A port to the PIC32MX has been completed, but is pending verification.
|
||||
Title: PIC32MX USB DRIVER UNTESTED
|
||||
Description: A USB device-side driver has been written for the PIC3MX,
|
||||
is completely untested as of this writing.
|
||||
Status: Open
|
||||
Priority: High
|
||||
Priority: Low -- unless you need a USB device-side driver.
|
||||
|
||||
o Hitachi/Renesas SH-1 (arch/sh/src/sh1)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -326,7 +326,7 @@ static ssize_t can_read(FAR struct file *filep, FAR char *buffer, size_t buflen)
|
||||
FAR struct can_msg_s *msg = &dev->cd_recv.cf_buffer[dev->cd_recv.cf_head];
|
||||
int msglen = CAN_MSGLEN(msg->cm_hdr);
|
||||
|
||||
if (ret + msglen > buflen)
|
||||
if (nread + msglen > buflen)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
12
fs/fs_stat.c
12
fs/fs_stat.c
@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* fs/fs_stat.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2009 , 2012Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -187,7 +187,7 @@ int stat(const char *path, FAR struct stat *buf)
|
||||
|
||||
if (inode->u.i_mops && inode->u.i_mops->stat)
|
||||
{
|
||||
/* Perform the rewinddir() operation */
|
||||
/* Perform the stat() operation */
|
||||
|
||||
ret = inode->u.i_mops->stat(inode, relpath, buf);
|
||||
}
|
||||
@ -215,10 +215,10 @@ int stat(const char *path, FAR struct stat *buf)
|
||||
|
||||
/* Failure conditions always set the errno appropriately */
|
||||
|
||||
errout_with_inode:
|
||||
errout_with_inode:
|
||||
inode_release(inode);
|
||||
errout:
|
||||
*get_errno_ptr() = ret;
|
||||
errout:
|
||||
set_errno(ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* fs/fs_statfs.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -57,10 +57,10 @@
|
||||
|
||||
static inline int statpsuedofs(FAR struct inode *inode, FAR struct statfs *buf)
|
||||
{
|
||||
memset(buf, 0, sizeof(struct statfs));
|
||||
buf->f_type = PROC_SUPER_MAGIC;
|
||||
buf->f_namelen = NAME_MAX;
|
||||
return OK;
|
||||
memset(buf, 0, sizeof(struct statfs));
|
||||
buf->f_type = PROC_SUPER_MAGIC;
|
||||
buf->f_namelen = NAME_MAX;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -116,7 +116,7 @@ int statfs(FAR const char *path, FAR struct statfs *buf)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
/* The way we handle the stat depends on the type of inode that we
|
||||
/* The way we handle the statfs depends on the type of inode that we
|
||||
* are dealing with.
|
||||
*/
|
||||
|
||||
@ -124,12 +124,12 @@ int statfs(FAR const char *path, FAR struct statfs *buf)
|
||||
if (INODE_IS_MOUNTPT(inode))
|
||||
{
|
||||
/* The node is a file system mointpoint. Verify that the mountpoint
|
||||
* supports the stat() method
|
||||
* supports the statfs() method
|
||||
*/
|
||||
|
||||
if (inode->u.i_mops && inode->u.i_mops->statfs)
|
||||
{
|
||||
/* Perform the rewinddir() operation */
|
||||
/* Perform the statfs() operation */
|
||||
|
||||
ret = inode->u.i_mops->statfs(inode, buf);
|
||||
}
|
||||
@ -142,7 +142,7 @@ int statfs(FAR const char *path, FAR struct statfs *buf)
|
||||
ret = statpsuedofs(inode, buf);
|
||||
}
|
||||
|
||||
/* Check if the stat operation was successful */
|
||||
/* Check if the statfs operation was successful */
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -150,16 +150,16 @@ int statfs(FAR const char *path, FAR struct statfs *buf)
|
||||
goto errout_with_inode;
|
||||
}
|
||||
|
||||
/* Successfully stat'ed the file */
|
||||
/* Successfully statfs'ed the file */
|
||||
|
||||
inode_release(inode);
|
||||
return OK;
|
||||
|
||||
/* Failure conditions always set the errno appropriately */
|
||||
|
||||
errout_with_inode:
|
||||
errout_with_inode:
|
||||
inode_release(inode);
|
||||
errout:
|
||||
*get_errno_ptr() = ret;
|
||||
errout:
|
||||
set_errno(ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
@ -94,9 +94,9 @@ int irq_attach(int irq, xcpt_t isr)
|
||||
/* Disable the interrupt if we can before detaching it. We might
|
||||
* not be able to do this if: (1) the device does not have a
|
||||
* centralized interrupt controller (so up_disable_irq() is not
|
||||
* supported. Or (2) if the device has different number for vector
|
||||
* supported). Or (2) if the device has different number for vector
|
||||
* numbers and IRQ numbers (in that case, we don't know the correct
|
||||
* IRQ number to use to disable the interrupt. In those cases, the
|
||||
* IRQ number to use to disable the interrupt). In those cases, the
|
||||
* code will just need to be careful that it disables all interrupt
|
||||
* sources before detaching from the interrupt vector.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user