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