mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
can: kvaser_pciefd: Set hardware timestamp on transmitted packets
Set hardware timestamp on transmitted packets.
Fixes: 26ad340e58 ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices")
Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/all/20230529134248.752036-5-extja@kvaser.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
committed by
Marc Kleine-Budde
parent
2d55e9f9b4
commit
ec681b91be
@@ -1485,6 +1485,7 @@ static void kvaser_pciefd_handle_nack_packet(struct kvaser_pciefd_can *can,
|
|||||||
|
|
||||||
if (skb) {
|
if (skb) {
|
||||||
cf->can_id |= CAN_ERR_BUSERROR;
|
cf->can_id |= CAN_ERR_BUSERROR;
|
||||||
|
kvaser_pciefd_set_skb_timestamp(can->kv_pcie, skb, p->timestamp);
|
||||||
netif_rx(skb);
|
netif_rx(skb);
|
||||||
} else {
|
} else {
|
||||||
stats->rx_dropped++;
|
stats->rx_dropped++;
|
||||||
@@ -1516,8 +1517,15 @@ static int kvaser_pciefd_handle_ack_packet(struct kvaser_pciefd *pcie,
|
|||||||
netdev_dbg(can->can.dev, "Packet was flushed\n");
|
netdev_dbg(can->can.dev, "Packet was flushed\n");
|
||||||
} else {
|
} else {
|
||||||
int echo_idx = p->header[0] & KVASER_PCIEFD_PACKET_SEQ_MSK;
|
int echo_idx = p->header[0] & KVASER_PCIEFD_PACKET_SEQ_MSK;
|
||||||
int dlc = can_get_echo_skb(can->can.dev, echo_idx, NULL);
|
int dlc;
|
||||||
u8 count = ioread32(can->reg_base +
|
u8 count;
|
||||||
|
struct sk_buff *skb;
|
||||||
|
|
||||||
|
skb = can->can.echo_skb[echo_idx];
|
||||||
|
if (skb)
|
||||||
|
kvaser_pciefd_set_skb_timestamp(pcie, skb, p->timestamp);
|
||||||
|
dlc = can_get_echo_skb(can->can.dev, echo_idx, NULL);
|
||||||
|
count = ioread32(can->reg_base +
|
||||||
KVASER_PCIEFD_KCAN_TX_NPACKETS_REG) & 0xff;
|
KVASER_PCIEFD_KCAN_TX_NPACKETS_REG) & 0xff;
|
||||||
|
|
||||||
if (count < KVASER_PCIEFD_CAN_TX_MAX_COUNT &&
|
if (count < KVASER_PCIEFD_CAN_TX_MAX_COUNT &&
|
||||||
|
|||||||
Reference in New Issue
Block a user