diff --git a/lte/include/lte/fec/crc.h b/lte/include/lte/fec/crc.h index fe35f992c..0844afca4 100644 --- a/lte/include/lte/fec/crc.h +++ b/lte/include/lte/fec/crc.h @@ -61,5 +61,7 @@ typedef struct { int crc_init(crc_t *crc_par); unsigned int crc_attach(char *bufptr, int len, crc_t *crc_params); +unsigned int crc(unsigned int crc, char *bufptr, int len, + int long_crc,unsigned int poly, int paste_word); #endif diff --git a/lte/lib/fec/src/crc.c b/lte/lib/fec/src/crc.c index b74569d9e..8a0cd92bf 100644 --- a/lte/lib/fec/src/crc.c +++ b/lte/lib/fec/src/crc.c @@ -154,3 +154,62 @@ unsigned int crc_attach(char *bufptr, int len, crc_t *crc_params) { //Return CRC value return crc; } + + +unsigned int cword; + +unsigned int icrc1(unsigned int crc, unsigned short onech,int long_crc, + int left_shift,unsigned int poly) +{ + int i; + unsigned int tmp=(unsigned int) (crc ^ (onech << (long_crc >> 1) )); + + for (i=0;i>long_crc), + data,long_crc,i,poly)<>long_crc; + } + + ret=cword; + if (paste_word) { + cword<<=32-long_crc; + for (i=0;i>31); + cword<<=1; + } + } + return (ret); +}