Lines Matching refs:crc8
105 struct cgw_csum_crc8 crc8; member
110 void (*crc8)(struct canfd_frame *cf, member
111 struct cgw_csum_crc8 *crc8);
304 struct cgw_csum_crc8 *crc8) in cgw_csum_crc8_rel() argument
306 int from = calc_idx(crc8->from_idx, cf->len); in cgw_csum_crc8_rel()
307 int to = calc_idx(crc8->to_idx, cf->len); in cgw_csum_crc8_rel()
308 int res = calc_idx(crc8->result_idx, cf->len); in cgw_csum_crc8_rel()
309 u8 crc = crc8->init_crc_val; in cgw_csum_crc8_rel()
316 for (i = crc8->from_idx; i <= crc8->to_idx; i++) in cgw_csum_crc8_rel()
317 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_rel()
319 for (i = crc8->from_idx; i >= crc8->to_idx; i--) in cgw_csum_crc8_rel()
320 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_rel()
323 switch (crc8->profile) { in cgw_csum_crc8_rel()
325 crc = crc8->crctab[crc ^ crc8->profile_data[0]]; in cgw_csum_crc8_rel()
329 crc = crc8->crctab[crc ^ crc8->profile_data[cf->data[1] & 0xF]]; in cgw_csum_crc8_rel()
333 crc = crc8->crctab[crc ^ (cf->can_id & 0xFF) ^ in cgw_csum_crc8_rel()
338 cf->data[crc8->result_idx] = crc ^ crc8->final_xor_val; in cgw_csum_crc8_rel()
342 struct cgw_csum_crc8 *crc8) in cgw_csum_crc8_pos() argument
344 u8 crc = crc8->init_crc_val; in cgw_csum_crc8_pos()
347 for (i = crc8->from_idx; i <= crc8->to_idx; i++) in cgw_csum_crc8_pos()
348 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_pos()
350 switch (crc8->profile) { in cgw_csum_crc8_pos()
352 crc = crc8->crctab[crc ^ crc8->profile_data[0]]; in cgw_csum_crc8_pos()
356 crc = crc8->crctab[crc ^ crc8->profile_data[cf->data[1] & 0xF]]; in cgw_csum_crc8_pos()
360 crc = crc8->crctab[crc ^ (cf->can_id & 0xFF) ^ in cgw_csum_crc8_pos()
365 cf->data[crc8->result_idx] = crc ^ crc8->final_xor_val; in cgw_csum_crc8_pos()
369 struct cgw_csum_crc8 *crc8) in cgw_csum_crc8_neg() argument
371 u8 crc = crc8->init_crc_val; in cgw_csum_crc8_neg()
374 for (i = crc8->from_idx; i >= crc8->to_idx; i--) in cgw_csum_crc8_neg()
375 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_neg()
377 switch (crc8->profile) { in cgw_csum_crc8_neg()
379 crc = crc8->crctab[crc ^ crc8->profile_data[0]]; in cgw_csum_crc8_neg()
383 crc = crc8->crctab[crc ^ crc8->profile_data[cf->data[1] & 0xF]]; in cgw_csum_crc8_neg()
387 crc = crc8->crctab[crc ^ (cf->can_id & 0xFF) ^ in cgw_csum_crc8_neg()
392 cf->data[crc8->result_idx] = crc ^ crc8->final_xor_val; in cgw_csum_crc8_neg()
488 if (gwj->mod.csumfunc.crc8) in can_can_gw_rcv()
489 (*gwj->mod.csumfunc.crc8)(cf, &gwj->mod.csum.crc8); in can_can_gw_rcv()
652 if (gwj->mod.csumfunc.crc8) { in cgw_put_job()
654 &gwj->mod.csum.crc8) < 0) in cgw_put_job()
912 nla_memcpy(&mod->csum.crc8, tb[CGW_CS_CRC8], in cgw_parse_attr()
920 mod->csumfunc.crc8 = cgw_csum_crc8_rel; in cgw_parse_attr()
922 mod->csumfunc.crc8 = cgw_csum_crc8_pos; in cgw_parse_attr()
924 mod->csumfunc.crc8 = cgw_csum_crc8_neg; in cgw_parse_attr()