gwj               398 net/can/gw.c   	struct cgw_job *gwj = (struct cgw_job *)data;
gwj               404 net/can/gw.c   	if (gwj->flags & CGW_FLAGS_CAN_FD) {
gwj               429 net/can/gw.c   		gwj->deleted_frames++;
gwj               433 net/can/gw.c   	if (!(gwj->dst.dev->flags & IFF_UP)) {
gwj               434 net/can/gw.c   		gwj->dropped_frames++;
gwj               439 net/can/gw.c   	if (!(gwj->flags & CGW_FLAGS_CAN_IIF_TX_OK) &&
gwj               440 net/can/gw.c   	    can_skb_prv(skb)->ifindex == gwj->dst.dev->ifindex)
gwj               448 net/can/gw.c   	if (gwj->mod.modfunc[0])
gwj               454 net/can/gw.c   		gwj->dropped_frames++;
gwj               462 net/can/gw.c   	if (gwj->limit_hops && cgw_hops(nskb) == 1)
gwj               463 net/can/gw.c   		cgw_hops(nskb) = max_hops - gwj->limit_hops + 1;
gwj               465 net/can/gw.c   	nskb->dev = gwj->dst.dev;
gwj               471 net/can/gw.c   	while (modidx < MAX_MODFUNCTIONS && gwj->mod.modfunc[modidx])
gwj               472 net/can/gw.c   		(*gwj->mod.modfunc[modidx++])(cf, &gwj->mod);
gwj               482 net/can/gw.c   			gwj->deleted_frames++;
gwj               488 net/can/gw.c   		if (gwj->mod.csumfunc.crc8)
gwj               489 net/can/gw.c   			(*gwj->mod.csumfunc.crc8)(cf, &gwj->mod.csum.crc8);
gwj               491 net/can/gw.c   		if (gwj->mod.csumfunc.xor)
gwj               492 net/can/gw.c   			(*gwj->mod.csumfunc.xor)(cf, &gwj->mod.csum.xor);
gwj               496 net/can/gw.c   	if (!(gwj->flags & CGW_FLAGS_CAN_SRC_TSTAMP))
gwj               500 net/can/gw.c   	if (can_send(nskb, gwj->flags & CGW_FLAGS_CAN_ECHO))
gwj               501 net/can/gw.c   		gwj->dropped_frames++;
gwj               503 net/can/gw.c   		gwj->handled_frames++;
gwj               506 net/can/gw.c   static inline int cgw_register_filter(struct net *net, struct cgw_job *gwj)
gwj               508 net/can/gw.c   	return can_rx_register(net, gwj->src.dev, gwj->ccgw.filter.can_id,
gwj               509 net/can/gw.c   			       gwj->ccgw.filter.can_mask, can_can_gw_rcv,
gwj               510 net/can/gw.c   			       gwj, "gw", NULL);
gwj               513 net/can/gw.c   static inline void cgw_unregister_filter(struct net *net, struct cgw_job *gwj)
gwj               515 net/can/gw.c   	can_rx_unregister(net, gwj->src.dev, gwj->ccgw.filter.can_id,
gwj               516 net/can/gw.c   			  gwj->ccgw.filter.can_mask, can_can_gw_rcv, gwj);
gwj               529 net/can/gw.c   		struct cgw_job *gwj = NULL;
gwj               534 net/can/gw.c   		hlist_for_each_entry_safe(gwj, nx, &net->can.cgw_list, list) {
gwj               535 net/can/gw.c   			if (gwj->src.dev == dev || gwj->dst.dev == dev) {
gwj               536 net/can/gw.c   				hlist_del(&gwj->list);
gwj               537 net/can/gw.c   				cgw_unregister_filter(net, gwj);
gwj               538 net/can/gw.c   				kmem_cache_free(cgw_cache, gwj);
gwj               546 net/can/gw.c   static int cgw_put_job(struct sk_buff *skb, struct cgw_job *gwj, int type,
gwj               558 net/can/gw.c   	rtcan->gwtype = gwj->gwtype;
gwj               559 net/can/gw.c   	rtcan->flags = gwj->flags;
gwj               563 net/can/gw.c   	if (gwj->handled_frames) {
gwj               564 net/can/gw.c   		if (nla_put_u32(skb, CGW_HANDLED, gwj->handled_frames) < 0)
gwj               568 net/can/gw.c   	if (gwj->dropped_frames) {
gwj               569 net/can/gw.c   		if (nla_put_u32(skb, CGW_DROPPED, gwj->dropped_frames) < 0)
gwj               573 net/can/gw.c   	if (gwj->deleted_frames) {
gwj               574 net/can/gw.c   		if (nla_put_u32(skb, CGW_DELETED, gwj->deleted_frames) < 0)
gwj               580 net/can/gw.c   	if (gwj->limit_hops) {
gwj               581 net/can/gw.c   		if (nla_put_u8(skb, CGW_LIM_HOPS, gwj->limit_hops) < 0)
gwj               585 net/can/gw.c   	if (gwj->flags & CGW_FLAGS_CAN_FD) {
gwj               588 net/can/gw.c   		if (gwj->mod.modtype.and) {
gwj               589 net/can/gw.c   			memcpy(&mb.cf, &gwj->mod.modframe.and, sizeof(mb.cf));
gwj               590 net/can/gw.c   			mb.modtype = gwj->mod.modtype.and;
gwj               595 net/can/gw.c   		if (gwj->mod.modtype.or) {
gwj               596 net/can/gw.c   			memcpy(&mb.cf, &gwj->mod.modframe.or, sizeof(mb.cf));
gwj               597 net/can/gw.c   			mb.modtype = gwj->mod.modtype.or;
gwj               602 net/can/gw.c   		if (gwj->mod.modtype.xor) {
gwj               603 net/can/gw.c   			memcpy(&mb.cf, &gwj->mod.modframe.xor, sizeof(mb.cf));
gwj               604 net/can/gw.c   			mb.modtype = gwj->mod.modtype.xor;
gwj               609 net/can/gw.c   		if (gwj->mod.modtype.set) {
gwj               610 net/can/gw.c   			memcpy(&mb.cf, &gwj->mod.modframe.set, sizeof(mb.cf));
gwj               611 net/can/gw.c   			mb.modtype = gwj->mod.modtype.set;
gwj               618 net/can/gw.c   		if (gwj->mod.modtype.and) {
gwj               619 net/can/gw.c   			memcpy(&mb.cf, &gwj->mod.modframe.and, sizeof(mb.cf));
gwj               620 net/can/gw.c   			mb.modtype = gwj->mod.modtype.and;
gwj               625 net/can/gw.c   		if (gwj->mod.modtype.or) {
gwj               626 net/can/gw.c   			memcpy(&mb.cf, &gwj->mod.modframe.or, sizeof(mb.cf));
gwj               627 net/can/gw.c   			mb.modtype = gwj->mod.modtype.or;
gwj               632 net/can/gw.c   		if (gwj->mod.modtype.xor) {
gwj               633 net/can/gw.c   			memcpy(&mb.cf, &gwj->mod.modframe.xor, sizeof(mb.cf));
gwj               634 net/can/gw.c   			mb.modtype = gwj->mod.modtype.xor;
gwj               639 net/can/gw.c   		if (gwj->mod.modtype.set) {
gwj               640 net/can/gw.c   			memcpy(&mb.cf, &gwj->mod.modframe.set, sizeof(mb.cf));
gwj               641 net/can/gw.c   			mb.modtype = gwj->mod.modtype.set;
gwj               647 net/can/gw.c   	if (gwj->mod.uid) {
gwj               648 net/can/gw.c   		if (nla_put_u32(skb, CGW_MOD_UID, gwj->mod.uid) < 0)
gwj               652 net/can/gw.c   	if (gwj->mod.csumfunc.crc8) {
gwj               654 net/can/gw.c   			    &gwj->mod.csum.crc8) < 0)
gwj               658 net/can/gw.c   	if (gwj->mod.csumfunc.xor) {
gwj               660 net/can/gw.c   			    &gwj->mod.csum.xor) < 0)
gwj               664 net/can/gw.c   	if (gwj->gwtype == CGW_TYPE_CAN_CAN) {
gwj               665 net/can/gw.c   		if (gwj->ccgw.filter.can_id || gwj->ccgw.filter.can_mask) {
gwj               667 net/can/gw.c   				    &gwj->ccgw.filter) < 0)
gwj               671 net/can/gw.c   		if (nla_put_u32(skb, CGW_SRC_IF, gwj->ccgw.src_idx) < 0)
gwj               674 net/can/gw.c   		if (nla_put_u32(skb, CGW_DST_IF, gwj->ccgw.dst_idx) < 0)
gwj               690 net/can/gw.c   	struct cgw_job *gwj = NULL;
gwj               695 net/can/gw.c   	hlist_for_each_entry_rcu(gwj, &net->can.cgw_list, list) {
gwj               699 net/can/gw.c   		if (cgw_put_job(skb, gwj, RTM_NEWROUTE,
gwj               993 net/can/gw.c   	struct cgw_job *gwj;
gwj              1021 net/can/gw.c   		hlist_for_each_entry(gwj, &net->can.cgw_list, list) {
gwj              1022 net/can/gw.c   			if (gwj->mod.uid != mod.uid)
gwj              1026 net/can/gw.c   			if (memcmp(&gwj->ccgw, &ccgw, sizeof(ccgw)))
gwj              1031 net/can/gw.c   			memcpy(&gwj->mod, &mod, sizeof(mod));
gwj              1041 net/can/gw.c   	gwj = kmem_cache_alloc(cgw_cache, GFP_KERNEL);
gwj              1042 net/can/gw.c   	if (!gwj)
gwj              1045 net/can/gw.c   	gwj->handled_frames = 0;
gwj              1046 net/can/gw.c   	gwj->dropped_frames = 0;
gwj              1047 net/can/gw.c   	gwj->deleted_frames = 0;
gwj              1048 net/can/gw.c   	gwj->flags = r->flags;
gwj              1049 net/can/gw.c   	gwj->gwtype = r->gwtype;
gwj              1050 net/can/gw.c   	gwj->limit_hops = limhops;
gwj              1053 net/can/gw.c   	memcpy(&gwj->mod, &mod, sizeof(mod));
gwj              1054 net/can/gw.c   	memcpy(&gwj->ccgw, &ccgw, sizeof(ccgw));
gwj              1058 net/can/gw.c   	gwj->src.dev = __dev_get_by_index(net, gwj->ccgw.src_idx);
gwj              1060 net/can/gw.c   	if (!gwj->src.dev)
gwj              1063 net/can/gw.c   	if (gwj->src.dev->type != ARPHRD_CAN)
gwj              1066 net/can/gw.c   	gwj->dst.dev = __dev_get_by_index(net, gwj->ccgw.dst_idx);
gwj              1068 net/can/gw.c   	if (!gwj->dst.dev)
gwj              1071 net/can/gw.c   	if (gwj->dst.dev->type != ARPHRD_CAN)
gwj              1076 net/can/gw.c   	err = cgw_register_filter(net, gwj);
gwj              1078 net/can/gw.c   		hlist_add_head_rcu(&gwj->list, &net->can.cgw_list);
gwj              1081 net/can/gw.c   		kmem_cache_free(cgw_cache, gwj);
gwj              1088 net/can/gw.c   	struct cgw_job *gwj = NULL;
gwj              1093 net/can/gw.c   	hlist_for_each_entry_safe(gwj, nx, &net->can.cgw_list, list) {
gwj              1094 net/can/gw.c   		hlist_del(&gwj->list);
gwj              1095 net/can/gw.c   		cgw_unregister_filter(net, gwj);
gwj              1096 net/can/gw.c   		kmem_cache_free(cgw_cache, gwj);
gwj              1104 net/can/gw.c   	struct cgw_job *gwj = NULL;
gwj              1141 net/can/gw.c   	hlist_for_each_entry_safe(gwj, nx, &net->can.cgw_list, list) {
gwj              1142 net/can/gw.c   		if (gwj->flags != r->flags)
gwj              1145 net/can/gw.c   		if (gwj->limit_hops != limhops)
gwj              1149 net/can/gw.c   		if (gwj->mod.uid || mod.uid) {
gwj              1150 net/can/gw.c   			if (gwj->mod.uid != mod.uid)
gwj              1154 net/can/gw.c   			if (memcmp(&gwj->mod, &mod, sizeof(mod)))
gwj              1159 net/can/gw.c   		if (memcmp(&gwj->ccgw, &ccgw, sizeof(ccgw)))
gwj              1162 net/can/gw.c   		hlist_del(&gwj->list);
gwj              1163 net/can/gw.c   		cgw_unregister_filter(net, gwj);
gwj              1164 net/can/gw.c   		kmem_cache_free(cgw_cache, gwj);