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
164 MODFUNC(mod_xor_id, cf->can_id ^= mod->modframe.xor.can_id)
165 MODFUNC(mod_xor_dlc, cf->can_dlc ^= mod->modframe.xor.can_dlc)
166 MODFUNC(mod_xor_data, *(u64 *)cf->data ^= *(u64 *)mod->modframe.xor.data)
211 static void cgw_csum_xor_rel(struct can_frame *cf, struct cgw_csum_xor *xor) in cgw_csum_xor_rel() argument
213 int from = calc_idx(xor->from_idx, cf->can_dlc); in cgw_csum_xor_rel()
214 int to = calc_idx(xor->to_idx, cf->can_dlc); in cgw_csum_xor_rel()
215 int res = calc_idx(xor->result_idx, cf->can_dlc); in cgw_csum_xor_rel()
216 u8 val = xor->init_xor_val; in cgw_csum_xor_rel()
233 static void cgw_csum_xor_pos(struct can_frame *cf, struct cgw_csum_xor *xor) in cgw_csum_xor_pos() argument
235 u8 val = xor->init_xor_val; in cgw_csum_xor_pos()
238 for (i = xor->from_idx; i <= xor->to_idx; i++) in cgw_csum_xor_pos()
241 cf->data[xor->result_idx] = val; in cgw_csum_xor_pos()
244 static void cgw_csum_xor_neg(struct can_frame *cf, struct cgw_csum_xor *xor) in cgw_csum_xor_neg() argument
246 u8 val = xor->init_xor_val; in cgw_csum_xor_neg()
249 for (i = xor->from_idx; i >= xor->to_idx; i--) in cgw_csum_xor_neg()
252 cf->data[xor->result_idx] = val; in cgw_csum_xor_neg()
425 if (gwj->mod.csumfunc.xor) in can_can_gw_rcv()
426 (*gwj->mod.csumfunc.xor)(cf, &gwj->mod.csum.xor); in can_can_gw_rcv()
537 if (gwj->mod.modtype.xor) { in cgw_put_job()
538 memcpy(&mb.cf, &gwj->mod.modframe.xor, sizeof(mb.cf)); in cgw_put_job()
539 mb.modtype = gwj->mod.modtype.xor; in cgw_put_job()
557 if (gwj->mod.csumfunc.xor) { in cgw_put_job()
559 &gwj->mod.csum.xor) < 0) in cgw_put_job()
685 canframecpy(&mod->modframe.xor, &mb.cf); in cgw_parse_attr()
686 mod->modtype.xor = mb.modtype; in cgw_parse_attr()
749 nla_memcpy(&mod->csum.xor, tb[CGW_CS_XOR], in cgw_parse_attr()
758 mod->csumfunc.xor = cgw_csum_xor_rel; in cgw_parse_attr()
760 mod->csumfunc.xor = cgw_csum_xor_pos; in cgw_parse_attr()
762 mod->csumfunc.xor = cgw_csum_xor_neg; in cgw_parse_attr()