Thread (26 messages) 26 messages, 5 authors, 2025-04-08

Re: [PATCH v7 4/7] can: Add Nuvoton NCT6694 CANFD support

From: Ming Yu <hidden>
Date: 2025-02-21 08:01:19
Also in: linux-can, linux-gpio, linux-hwmon, linux-i2c, linux-rtc, linux-usb, linux-watchdog, lkml

Hi Marc,

Marc Kleine-Budde [off-list ref] 於 2025年2月7日 週五 下午8:15寫道:
quoted
+static irqreturn_t nct6694_can_irq(int irq, void *data)
+{
+     struct net_device *ndev = data;
+     struct nct6694_can_priv *priv = netdev_priv(ndev);
+     struct nct6694_can_event *evt = priv->event;
+     struct nct6694_cmd_header cmd_hd = {
+             .mod = NCT6694_CAN_MOD,
+             .cmd = NCT6694_CAN_EVENT,
+             .sel = NCT6694_CAN_EVENT_SEL(priv->can_idx, NCT6694_CAN_EVENT_MASK),
+             .len = cpu_to_le16(sizeof(priv->event))
+     };
+     irqreturn_t handled = IRQ_NONE;
+     int can_idx = priv->can_idx;
+     int ret;
it would make sense to have a event pointer here instead of the can_idx?

        const struct nct6694_can_event *event = &priv->event[priv->can_idx];
The CAN Event command always returns 16bytes: the first 8 bytes
correspond to the CAN0 event, and the last 8 bytes correspond to the
CAN1 event. Therefore, the event pointer here refers to both event
buffers.

Thanks,
Ming
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help