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

Attachment: signature.asc
Description: OpenPGP digital signature


[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