Re: [PATCH 3/3] can/peak_usb: add support of ONE_SHOT mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 09.03.21 11:36, Marc Kleine-Budde wrote:
On 3/9/21 9:21 AM, Stephane Grosjean wrote:
This patch adds "ONE-SHOT" mode support to the following CAN-USB
PEAK-System GmbH interfaces:
- PCAN-USB X6
- PCAN-USB FD
- PCAN-USB Pro FD
- PCAN-Chip USB
- PCAN-USB Pro

Signed-off-by: Stephane Grosjean <s.grosjean@xxxxxxxxxxxxxxx>

What happens if in one shot mode and the frame is not send? Who takes care of
the echo skb?

ONE-SHOT only means that the CAN controller would not retry the transmission when e.g. loosing the arbitration or getting an error flag.

The sja1000 does it this way, when the TX interrupt flag is set in the interrupt register:

                if (isrc & IRQ_TI) {
                        /* transmission buffer released */
                        if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT &&
                            !(status & SR_TCS)) {
                                stats->tx_errors++;
                                can_free_echo_skb(dev, 0);
                        } else {
                                /* transmission complete */
                                stats->tx_bytes +=
priv->read_reg(priv, SJA1000_FI) & 0xf;
                                stats->tx_packets++;
                                can_get_echo_skb(dev, 0, NULL);
                        }
                        netif_wake_queue(dev);
                        can_led_event(dev, CAN_LED_EVENT_TX);
                }


Do we need to check this for the other drivers?

Regards,
Oliver



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux