the CAN frame (which saves some time, if the timestamp is not needed).
Usually the skb->tstamp is cleared which makes the destination interface
create a new timestamp (e.g. when the frame hit's the bus) on loopback.
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1130
030b6a49-0b11-0410-94ab-
b0dab22257f2
};
#define CAN_GW_TXFLAGS_LOOPBACK 0x01
};
#define CAN_GW_TXFLAGS_LOOPBACK 0x01
+#define CAN_GW_TXFLAGS_SRC_TSTAMP 0x02
/* CAN rtnetlink attribute definitions */
enum {
/* CAN rtnetlink attribute definitions */
enum {
/* content of u32 gwjob.flags */
#define CAN_TX_LOOPBACK 0x00000001
/* content of u32 gwjob.flags */
#define CAN_TX_LOOPBACK 0x00000001
+#define CAN_TX_SRC_TSTAMP 0x00000002
/* modification functions that are invoked in the hot path in gw_rcv */
void mod_and_id (struct can_frame *cf, struct can_can_gw *mod) {
/* modification functions that are invoked in the hot path in gw_rcv */
void mod_and_id (struct can_frame *cf, struct can_can_gw *mod) {
while (modidx < MAX_MODFUNCTIONS && gwj->ccgw.modfunc[modidx])
(*gwj->ccgw.modfunc[modidx++])(cf, &gwj->ccgw);
while (modidx < MAX_MODFUNCTIONS && gwj->ccgw.modfunc[modidx])
(*gwj->ccgw.modfunc[modidx++])(cf, &gwj->ccgw);
+ /* clear the skb timestamp if not configured the other way */
+ if (!(gwj->flags & CAN_TX_SRC_TSTAMP))
+ skb->tstamp.tv64 = 0;
+
/* send to netdevice */
if (can_send(nskb, gwj->flags & CAN_TX_LOOPBACK))
gwj->dropped_frames++;
/* send to netdevice */
if (can_send(nskb, gwj->flags & CAN_TX_LOOPBACK))
gwj->dropped_frames++;
if (r->can_txflags & CAN_GW_TXFLAGS_LOOPBACK)
gwj->flags |= CAN_TX_LOOPBACK;
if (r->can_txflags & CAN_GW_TXFLAGS_LOOPBACK)
gwj->flags |= CAN_TX_LOOPBACK;
+ if (r->can_txflags & CAN_GW_TXFLAGS_SRC_TSTAMP)
+ gwj->flags |= CAN_TX_SRC_TSTAMP;
+
memset(&gwj->ccgw, 0, sizeof(gwj->ccgw));
/* check for additional attributes / filters here */
memset(&gwj->ccgw, 0, sizeof(gwj->ccgw));
/* check for additional attributes / filters here */