Lines Matching refs:xor
89 struct canfd_frame xor;
95 u8 xor;
103 struct cgw_csum_xor xor;
107 void (*xor)(struct canfd_frame *cf,
108 struct cgw_csum_xor *xor);
164 MODFUNC(mod_xor_id, cf->can_id ^= mod->modframe.xor.can_id)
165 MODFUNC(mod_xor_len, cf->len ^= mod->modframe.xor.len)
166 MODFUNC(mod_xor_flags, cf->flags ^= mod->modframe.xor.flags)
167 MODFUNC(mod_xor_data, *(u64 *)cf->data ^= *(u64 *)mod->modframe.xor.data)
194 *(u64 *)(cf->data + i) ^= *(u64 *)(mod->modframe.xor.data + i);
258 static void cgw_csum_xor_rel(struct canfd_frame *cf, struct cgw_csum_xor *xor)
260 int from = calc_idx(xor->from_idx, cf->len);
261 int to = calc_idx(xor->to_idx, cf->len);
262 int res = calc_idx(xor->result_idx, cf->len);
263 u8 val = xor->init_xor_val;
280 static void cgw_csum_xor_pos(struct canfd_frame *cf, struct cgw_csum_xor *xor)
282 u8 val = xor->init_xor_val;
285 for (i = xor->from_idx; i <= xor->to_idx; i++)
288 cf->data[xor->result_idx] = val;
291 static void cgw_csum_xor_neg(struct canfd_frame *cf, struct cgw_csum_xor *xor)
293 u8 val = xor->init_xor_val;
296 for (i = xor->from_idx; i >= xor->to_idx; i--)
299 cf->data[xor->result_idx] = val;
490 if (gwj->mod.csumfunc.xor)
491 (*gwj->mod.csumfunc.xor)(cf, &gwj->mod.csum.xor);
602 if (gwj->mod.modtype.xor) {
603 memcpy(&mb.cf, &gwj->mod.modframe.xor, sizeof(mb.cf));
604 mb.modtype = gwj->mod.modtype.xor;
632 if (gwj->mod.modtype.xor) {
633 memcpy(&mb.cf, &gwj->mod.modframe.xor, sizeof(mb.cf));
634 mb.modtype = gwj->mod.modtype.xor;
658 if (gwj->mod.csumfunc.xor) {
660 &gwj->mod.csum.xor) < 0)
800 canfdframecpy(&mod->modframe.xor, &mb.cf);
801 mod->modtype.xor = mb.modtype;
872 canframecpy(&mod->modframe.xor, &mb.cf);
873 mod->modtype.xor = mb.modtype;
935 nla_memcpy(&mod->csum.xor, tb[CGW_CS_XOR],
943 mod->csumfunc.xor = cgw_csum_xor_rel;
945 mod->csumfunc.xor = cgw_csum_xor_pos;
947 mod->csumfunc.xor = cgw_csum_xor_neg;