Thread (18 messages) 18 messages, 4 authors, 2021-03-19

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

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2021-03-09 10:59:18

On 3/9/21 11:53 AM, Oliver Hartkopp wrote:
quoted
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?
Yes.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachments

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