Lines Matching refs:crc8
104 struct cgw_csum_crc8 crc8; member
109 void (*crc8)(struct canfd_frame *cf, member
110 struct cgw_csum_crc8 *crc8);
303 struct cgw_csum_crc8 *crc8) in cgw_csum_crc8_rel() argument
305 int from = calc_idx(crc8->from_idx, cf->len); in cgw_csum_crc8_rel()
306 int to = calc_idx(crc8->to_idx, cf->len); in cgw_csum_crc8_rel()
307 int res = calc_idx(crc8->result_idx, cf->len); in cgw_csum_crc8_rel()
308 u8 crc = crc8->init_crc_val; in cgw_csum_crc8_rel()
315 for (i = crc8->from_idx; i <= crc8->to_idx; i++) in cgw_csum_crc8_rel()
316 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_rel()
318 for (i = crc8->from_idx; i >= crc8->to_idx; i--) in cgw_csum_crc8_rel()
319 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_rel()
322 switch (crc8->profile) { in cgw_csum_crc8_rel()
324 crc = crc8->crctab[crc ^ crc8->profile_data[0]]; in cgw_csum_crc8_rel()
328 crc = crc8->crctab[crc ^ crc8->profile_data[cf->data[1] & 0xF]]; in cgw_csum_crc8_rel()
332 crc = crc8->crctab[crc ^ (cf->can_id & 0xFF) ^ in cgw_csum_crc8_rel()
337 cf->data[crc8->result_idx] = crc ^ crc8->final_xor_val; in cgw_csum_crc8_rel()
341 struct cgw_csum_crc8 *crc8) in cgw_csum_crc8_pos() argument
343 u8 crc = crc8->init_crc_val; in cgw_csum_crc8_pos()
346 for (i = crc8->from_idx; i <= crc8->to_idx; i++) in cgw_csum_crc8_pos()
347 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_pos()
349 switch (crc8->profile) { in cgw_csum_crc8_pos()
351 crc = crc8->crctab[crc ^ crc8->profile_data[0]]; in cgw_csum_crc8_pos()
355 crc = crc8->crctab[crc ^ crc8->profile_data[cf->data[1] & 0xF]]; in cgw_csum_crc8_pos()
359 crc = crc8->crctab[crc ^ (cf->can_id & 0xFF) ^ in cgw_csum_crc8_pos()
364 cf->data[crc8->result_idx] = crc ^ crc8->final_xor_val; in cgw_csum_crc8_pos()
368 struct cgw_csum_crc8 *crc8) in cgw_csum_crc8_neg() argument
370 u8 crc = crc8->init_crc_val; in cgw_csum_crc8_neg()
373 for (i = crc8->from_idx; i >= crc8->to_idx; i--) in cgw_csum_crc8_neg()
374 crc = crc8->crctab[crc ^ cf->data[i]]; in cgw_csum_crc8_neg()
376 switch (crc8->profile) { in cgw_csum_crc8_neg()
378 crc = crc8->crctab[crc ^ crc8->profile_data[0]]; in cgw_csum_crc8_neg()
382 crc = crc8->crctab[crc ^ crc8->profile_data[cf->data[1] & 0xF]]; in cgw_csum_crc8_neg()
386 crc = crc8->crctab[crc ^ (cf->can_id & 0xFF) ^ in cgw_csum_crc8_neg()
391 cf->data[crc8->result_idx] = crc ^ crc8->final_xor_val; in cgw_csum_crc8_neg()
487 if (gwj->mod.csumfunc.crc8) in can_can_gw_rcv()
488 (*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()