Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit faa233d9 authored by Stephane Grosjean's avatar Stephane Grosjean Committed by Marc Kleine-Budde
Browse files

can: peak_usb: add peak_usb_netif_rx() new function



Add a common function that pushes the skb in the network queue with adding
timestamps information, converted from time values read from the
PEAK USB adapters.

Signed-off-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 1114be1e
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -163,6 +163,21 @@ void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts,
	}
	}
}
}


/*
 * post received skb after having set any hw timestamp
 */
int peak_usb_netif_rx(struct sk_buff *skb,
		      struct peak_time_ref *time_ref, u32 ts_low, u32 ts_high)
{
	struct skb_shared_hwtstamps *hwts = skb_hwtstamps(skb);
	struct timeval tv;

	peak_usb_get_ts_tv(time_ref, ts_low, &tv);
	hwts->hwtstamp = timeval_to_ktime(tv);

	return netif_rx(skb);
}

/*
/*
 * callback for bulk Rx urb
 * callback for bulk Rx urb
 */
 */
+3 −1
Original line number Original line Diff line number Diff line
@@ -145,7 +145,9 @@ void peak_usb_update_ts_now(struct peak_time_ref *time_ref, u32 ts_now);
void peak_usb_set_ts_now(struct peak_time_ref *time_ref, u32 ts_now);
void peak_usb_set_ts_now(struct peak_time_ref *time_ref, u32 ts_now);
void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts,
void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts,
			struct timeval *tv);
			struct timeval *tv);

int peak_usb_netif_rx(struct sk_buff *skb,
		      struct peak_time_ref *time_ref, u32 ts_low, u32 ts_high);
void peak_usb_async_complete(struct urb *urb);
void peak_usb_async_complete(struct urb *urb);
void peak_usb_restart_complete(struct peak_usb_device *dev);
void peak_usb_restart_complete(struct peak_usb_device *dev);

#endif
#endif