From 874862abb9b4ef6d227d9032118b401c3df74a20 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 8 Nov 2015 07:00:09 -0600 Subject: [PATCH] CAN driver: Improve some comments --- arch | 2 +- drivers/can.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/arch b/arch index 2137b6c754..c3b18f485b 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 2137b6c754118003664432d16dd4b69685939c74 +Subproject commit c3b18f485b208adcc005f39d50c202e4ae795e91 diff --git a/drivers/can.c b/drivers/can.c index 3548729388..8ac3e189ce 100644 --- a/drivers/can.c +++ b/drivers/can.c @@ -1109,18 +1109,27 @@ int can_txready(FAR struct can_dev_s *dev) if (dev->cd_ntxwaiters > 0) { /* Verify that the xmit FIFO is not empty. + * * REVISIT: This probably should be an assertion since we should only * be waiting for space in the xmit FIFO if the xmit FIFO is full. */ if (dev->cd_xmit.tx_head != dev->cd_xmit.tx_tail) { - /* Send the next message in the FIFO, making space in the xmit FIFO */ + /* Send the next message in the S/W FIFO. In the case where the + * H/W TX FIFO is not empty, this should add one more CAN message + * to the H/W TX FIFO and can_txdone() should be called, making + * space in the S/W FIFO + */ (void)can_xmit(dev); } - /* Inform one waiter that new xmit space is available */ + /* Inform one waiter that new xmit space is available in the S/W FIFO. + * NOTE that is can_txdone() is, indeed, called twice that the tx_sem + * will also be posted twice. This is a little inefficient, but not + * harmful. + */ ret = sem_post(&dev->cd_xmit.tx_sem); }