diff options
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb.c | 8 | ||||
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c index 86f26a1ede4c..25723d8ee201 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb.c | |||
@@ -519,8 +519,10 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n, | |||
519 | mc->pdev->dev.can.state = new_state; | 519 | mc->pdev->dev.can.state = new_state; |
520 | 520 | ||
521 | if (status_len & PCAN_USB_STATUSLEN_TIMESTAMP) { | 521 | if (status_len & PCAN_USB_STATUSLEN_TIMESTAMP) { |
522 | struct skb_shared_hwtstamps *hwts = skb_hwtstamps(skb); | ||
523 | |||
522 | peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv); | 524 | peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv); |
523 | skb->tstamp = timeval_to_ktime(tv); | 525 | hwts->hwtstamp = timeval_to_ktime(tv); |
524 | } | 526 | } |
525 | 527 | ||
526 | netif_rx(skb); | 528 | netif_rx(skb); |
@@ -605,6 +607,7 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len) | |||
605 | struct sk_buff *skb; | 607 | struct sk_buff *skb; |
606 | struct can_frame *cf; | 608 | struct can_frame *cf; |
607 | struct timeval tv; | 609 | struct timeval tv; |
610 | struct skb_shared_hwtstamps *hwts; | ||
608 | 611 | ||
609 | skb = alloc_can_skb(mc->netdev, &cf); | 612 | skb = alloc_can_skb(mc->netdev, &cf); |
610 | if (!skb) | 613 | if (!skb) |
@@ -652,7 +655,8 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len) | |||
652 | 655 | ||
653 | /* convert timestamp into kernel time */ | 656 | /* convert timestamp into kernel time */ |
654 | peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv); | 657 | peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv); |
655 | skb->tstamp = timeval_to_ktime(tv); | 658 | hwts = skb_hwtstamps(skb); |
659 | hwts->hwtstamp = timeval_to_ktime(tv); | ||
656 | 660 | ||
657 | /* push the skb */ | 661 | /* push the skb */ |
658 | netif_rx(skb); | 662 | netif_rx(skb); |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c index e1626d92511a..30d79bfa5b10 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c | |||
@@ -532,6 +532,7 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if, | |||
532 | struct can_frame *can_frame; | 532 | struct can_frame *can_frame; |
533 | struct sk_buff *skb; | 533 | struct sk_buff *skb; |
534 | struct timeval tv; | 534 | struct timeval tv; |
535 | struct skb_shared_hwtstamps *hwts; | ||
535 | 536 | ||
536 | skb = alloc_can_skb(netdev, &can_frame); | 537 | skb = alloc_can_skb(netdev, &can_frame); |
537 | if (!skb) | 538 | if (!skb) |
@@ -549,7 +550,8 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if, | |||
549 | memcpy(can_frame->data, rx->data, can_frame->can_dlc); | 550 | memcpy(can_frame->data, rx->data, can_frame->can_dlc); |
550 | 551 | ||
551 | peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(rx->ts32), &tv); | 552 | peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(rx->ts32), &tv); |
552 | skb->tstamp = timeval_to_ktime(tv); | 553 | hwts = skb_hwtstamps(skb); |
554 | hwts->hwtstamp = timeval_to_ktime(tv); | ||
553 | 555 | ||
554 | netif_rx(skb); | 556 | netif_rx(skb); |
555 | netdev->stats.rx_packets++; | 557 | netdev->stats.rx_packets++; |
@@ -570,6 +572,7 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if, | |||
570 | u8 err_mask = 0; | 572 | u8 err_mask = 0; |
571 | struct sk_buff *skb; | 573 | struct sk_buff *skb; |
572 | struct timeval tv; | 574 | struct timeval tv; |
575 | struct skb_shared_hwtstamps *hwts; | ||
573 | 576 | ||
574 | /* nothing should be sent while in BUS_OFF state */ | 577 | /* nothing should be sent while in BUS_OFF state */ |
575 | if (dev->can.state == CAN_STATE_BUS_OFF) | 578 | if (dev->can.state == CAN_STATE_BUS_OFF) |
@@ -664,7 +667,8 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if, | |||
664 | dev->can.state = new_state; | 667 | dev->can.state = new_state; |
665 | 668 | ||
666 | peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(er->ts32), &tv); | 669 | peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(er->ts32), &tv); |
667 | skb->tstamp = timeval_to_ktime(tv); | 670 | hwts = skb_hwtstamps(skb); |
671 | hwts->hwtstamp = timeval_to_ktime(tv); | ||
668 | netif_rx(skb); | 672 | netif_rx(skb); |
669 | netdev->stats.rx_packets++; | 673 | netdev->stats.rx_packets++; |
670 | netdev->stats.rx_bytes += can_frame->can_dlc; | 674 | netdev->stats.rx_bytes += can_frame->can_dlc; |