Lines Matching refs:xor

92 		struct can_frame xor;  member
98 u8 xor; member
106 struct cgw_csum_xor xor; member
110 void (*xor)(struct can_frame *cf, struct cgw_csum_xor *xor); member
165 MODFUNC(mod_xor_id, cf->can_id ^= mod->modframe.xor.can_id)
166 MODFUNC(mod_xor_dlc, cf->can_dlc ^= mod->modframe.xor.can_dlc)
167 MODFUNC(mod_xor_data, *(u64 *)cf->data ^= *(u64 *)mod->modframe.xor.data)
212 static void cgw_csum_xor_rel(struct can_frame *cf, struct cgw_csum_xor *xor) in cgw_csum_xor_rel() argument
214 int from = calc_idx(xor->from_idx, cf->can_dlc); in cgw_csum_xor_rel()
215 int to = calc_idx(xor->to_idx, cf->can_dlc); in cgw_csum_xor_rel()
216 int res = calc_idx(xor->result_idx, cf->can_dlc); in cgw_csum_xor_rel()
217 u8 val = xor->init_xor_val; in cgw_csum_xor_rel()
234 static void cgw_csum_xor_pos(struct can_frame *cf, struct cgw_csum_xor *xor) in cgw_csum_xor_pos() argument
236 u8 val = xor->init_xor_val; in cgw_csum_xor_pos()
239 for (i = xor->from_idx; i <= xor->to_idx; i++) in cgw_csum_xor_pos()
242 cf->data[xor->result_idx] = val; in cgw_csum_xor_pos()
245 static void cgw_csum_xor_neg(struct can_frame *cf, struct cgw_csum_xor *xor) in cgw_csum_xor_neg() argument
247 u8 val = xor->init_xor_val; in cgw_csum_xor_neg()
250 for (i = xor->from_idx; i >= xor->to_idx; i--) in cgw_csum_xor_neg()
253 cf->data[xor->result_idx] = val; in cgw_csum_xor_neg()
426 if (gwj->mod.csumfunc.xor) in can_can_gw_rcv()
427 (*gwj->mod.csumfunc.xor)(cf, &gwj->mod.csum.xor); in can_can_gw_rcv()
538 if (gwj->mod.modtype.xor) { in cgw_put_job()
539 memcpy(&mb.cf, &gwj->mod.modframe.xor, sizeof(mb.cf)); in cgw_put_job()
540 mb.modtype = gwj->mod.modtype.xor; in cgw_put_job()
563 if (gwj->mod.csumfunc.xor) { in cgw_put_job()
565 &gwj->mod.csum.xor) < 0) in cgw_put_job()
692 canframecpy(&mod->modframe.xor, &mb.cf); in cgw_parse_attr()
693 mod->modtype.xor = mb.modtype; in cgw_parse_attr()
756 nla_memcpy(&mod->csum.xor, tb[CGW_CS_XOR], in cgw_parse_attr()
765 mod->csumfunc.xor = cgw_csum_xor_rel; in cgw_parse_attr()
767 mod->csumfunc.xor = cgw_csum_xor_pos; in cgw_parse_attr()
769 mod->csumfunc.xor = cgw_csum_xor_neg; in cgw_parse_attr()