You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "jwang12340 (via GitHub)" <gi...@apache.org> on 2026/02/02 07:37:44 UTC

Re: [PR] drivers/can: Enhance CTU CAN FD QEMU charcan driver (6 commits) [nuttx]

jwang12340 commented on code in PR #18039:
URL: https://github.com/apache/nuttx/pull/18039#discussion_r2752965769


##########
drivers/can/ctucanfd_pci.c:
##########
@@ -800,6 +803,70 @@ static int ctucanfd_chrdev_txconfirm(struct can_dev_s *dev, int idx)
 }
 #endif
 
+/*****************************************************************************
+ * Name: ctucanfd_chrdev_cancel
+ *
+ * Description:
+ *   Cancel one can message.
+ *
+ * Input Parameters:
+ *   dev - An instance of the "upper half" can driver state structure.
+ *   msg - One can message.
+ *
+ * Returned Value:
+ *   true on success; zero on failure.
+ *****************************************************************************/
+
+static bool ctucanfd_chrdev_cancel(FAR struct can_dev_s *dev,
+                                   FAR struct can_msg_s *msg)
+{
+  FAR struct ctucanfd_can_s *priv = (FAR struct ctucanfd_can_s *)dev;
+  uint32_t regval;
+  uint32_t offset;
+  uint32_t id;
+  int i;
+
+  /* Find TXB to be canceled */
+
+  for (i = 0; i < CTUCANFD_TXBUF_CNT; i++)
+    {
+      offset = CTUCANFD_TXT1 + CTUCANFD_TXT_SIZE * i;
+      id = ctucanfd_getreg(priv, offset + CTUCANFD_TXBUF_ID);

Review Comment:
   Thanks for the advice, add a new commit to updated it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org