Lines Matching full:crc8
104 struct cgw_csum_crc8 crc8; member
109 void (*crc8)(struct canfd_frame *cf, member
110 struct cgw_csum_crc8 *crc8);
365 struct cgw_csum_crc8 *crc8) in cgw_csum_crc8_rel() argument
367 int from = calc_idx(crc8->from_idx, cf->len); in cgw_csum_crc8_rel()
368 int to = calc_idx(crc8->to_idx, cf->len); in cgw_csum_crc8_rel()
369 int res = calc_idx(crc8->result_idx, cf->len); in cgw_csum_crc8_rel()
370 u8 crc = crc8->init_crc_val; in cgw_csum_crc8_rel()
377 for (i = crc8->from_idx; i <= crc8->to_idx; i++) in cgw_csum_crc8_rel()
378 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_rel()
380 for (i = crc8->from_idx; i >= crc8->to_idx; i--) in cgw_csum_crc8_rel()
381 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_rel()
384 switch (crc8->profile) { in cgw_csum_crc8_rel()
386 crc = crc8->crctab[crc ^ crc8->profile_data[0]]; in cgw_csum_crc8_rel()
390 crc = crc8->crctab[crc ^ crc8->profile_data[cf->data[1] & 0xF]]; in cgw_csum_crc8_rel()
394 crc = crc8->crctab[crc ^ (cf->can_id & 0xFF) ^ in cgw_csum_crc8_rel()
399 cf->data[crc8->result_idx] = crc ^ crc8->final_xor_val; in cgw_csum_crc8_rel()
403 struct cgw_csum_crc8 *crc8) in cgw_csum_crc8_pos() argument
405 u8 crc = crc8->init_crc_val; in cgw_csum_crc8_pos()
408 for (i = crc8->from_idx; i <= crc8->to_idx; i++) in cgw_csum_crc8_pos()
409 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_pos()
411 switch (crc8->profile) { in cgw_csum_crc8_pos()
413 crc = crc8->crctab[crc ^ crc8->profile_data[0]]; in cgw_csum_crc8_pos()
417 crc = crc8->crctab[crc ^ crc8->profile_data[cf->data[1] & 0xF]]; in cgw_csum_crc8_pos()
421 crc = crc8->crctab[crc ^ (cf->can_id & 0xFF) ^ in cgw_csum_crc8_pos()
426 cf->data[crc8->result_idx] = crc ^ crc8->final_xor_val; in cgw_csum_crc8_pos()
430 struct cgw_csum_crc8 *crc8) in cgw_csum_crc8_neg() argument
432 u8 crc = crc8->init_crc_val; in cgw_csum_crc8_neg()
435 for (i = crc8->from_idx; i >= crc8->to_idx; i--) in cgw_csum_crc8_neg()
436 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_neg()
438 switch (crc8->profile) { in cgw_csum_crc8_neg()
440 crc = crc8->crctab[crc ^ crc8->profile_data[0]]; in cgw_csum_crc8_neg()
444 crc = crc8->crctab[crc ^ crc8->profile_data[cf->data[1] & 0xF]]; in cgw_csum_crc8_neg()
448 crc = crc8->crctab[crc ^ (cf->can_id & 0xFF) ^ in cgw_csum_crc8_neg()
453 cf->data[crc8->result_idx] = crc ^ crc8->final_xor_val; in cgw_csum_crc8_neg()
549 if (gwj->mod.csumfunc.crc8) in can_can_gw_rcv()
550 (*gwj->mod.csumfunc.crc8)(cf, &gwj->mod.csum.crc8); in can_can_gw_rcv()
720 if (gwj->mod.csumfunc.crc8) { in cgw_put_job()
722 &gwj->mod.csum.crc8) < 0) in cgw_put_job()
980 nla_memcpy(&mod->csum.crc8, tb[CGW_CS_CRC8], in cgw_parse_attr()
988 mod->csumfunc.crc8 = cgw_csum_crc8_rel; in cgw_parse_attr()
990 mod->csumfunc.crc8 = cgw_csum_crc8_pos; in cgw_parse_attr()
992 mod->csumfunc.crc8 = cgw_csum_crc8_neg; in cgw_parse_attr()