Lines Matching refs:hCrcInfo
194 HANDLE_FDK_CRCINFO hCrcInfo,
203 HANDLE_FDK_CRCINFO hCrcInfo, in FDKcrcInit() argument
214 hCrcInfo->crcLen = crcLen; in FDKcrcInit()
215 hCrcInfo->crcPoly = crcPoly; in FDKcrcInit()
216 hCrcInfo->startValue = crcStartValue; in FDKcrcInit()
217 hCrcInfo->crcMask = (crcLen) ? (1<<(crcLen-1)) : 0; in FDKcrcInit()
219 FDKcrcReset(hCrcInfo); in FDKcrcInit()
221 hCrcInfo->pCrcLookup = 0; in FDKcrcInit()
223 if (hCrcInfo->crcLen==16) { in FDKcrcInit()
226 hCrcInfo->pCrcLookup = crcLookup_16_15_2_0; in FDKcrcInit()
229 hCrcInfo->pCrcLookup = crcLookup_16_12_5_0; in FDKcrcInit()
234 hCrcInfo->pCrcLookup = 0; in FDKcrcInit()
241 void FDKcrcReset(HANDLE_FDK_CRCINFO hCrcInfo) in FDKcrcReset() argument
245 hCrcInfo->crcValue = hCrcInfo->startValue; in FDKcrcReset()
248 hCrcInfo->crcRegData[i].isActive = 0; in FDKcrcReset()
250 hCrcInfo->regStart = 0; in FDKcrcReset()
251 hCrcInfo->regStop = 0; in FDKcrcReset()
255 HANDLE_FDK_CRCINFO hCrcInfo, in FDKcrcStartReg() argument
260 int reg = hCrcInfo->regStart; in FDKcrcStartReg()
262 FDK_ASSERT(hCrcInfo->crcRegData[reg].isActive==0); in FDKcrcStartReg()
263 hCrcInfo->crcRegData[reg].isActive = 1; in FDKcrcStartReg()
264 hCrcInfo->crcRegData[reg].maxBits = mBits; in FDKcrcStartReg()
265 hCrcInfo->crcRegData[reg].validBits = FDKgetValidBits(hBs) ; in FDKcrcStartReg()
266 hCrcInfo->crcRegData[reg].bitBufCntBits = 0; in FDKcrcStartReg()
268 hCrcInfo->regStart = (hCrcInfo->regStart+1)%MAX_CRC_REGS; in FDKcrcStartReg()
274 HANDLE_FDK_CRCINFO hCrcInfo, in FDKcrcEndReg() argument
279 FDK_ASSERT((reg==(INT)hCrcInfo->regStop)&&(hCrcInfo->crcRegData[reg].isActive==1)); in FDKcrcEndReg()
282 …hCrcInfo->crcRegData[reg].bitBufCntBits = FDKgetValidBits(hBs) - hCrcInfo->crcRegData[reg].validBi… in FDKcrcEndReg()
285 …hCrcInfo->crcRegData[reg].bitBufCntBits = hCrcInfo->crcRegData[reg].validBits - FDKgetValidBits(hB… in FDKcrcEndReg()
288 if (hCrcInfo->crcRegData[reg].maxBits == 0) { in FDKcrcEndReg()
289 hCrcInfo->crcRegData[reg].maxBits = hCrcInfo->crcRegData[reg].bitBufCntBits; in FDKcrcEndReg()
292 crcCalc( hCrcInfo, hBs, reg); in FDKcrcEndReg()
294 hCrcInfo->crcRegData[reg].isActive = 0; in FDKcrcEndReg()
295 hCrcInfo->regStop = (hCrcInfo->regStop+1)%MAX_CRC_REGS; in FDKcrcEndReg()
301 const HANDLE_FDK_CRCINFO hCrcInfo in FDKcrcGetCRC() argument
304 return ( hCrcInfo->crcValue & (((hCrcInfo->crcMask-1)<<1)+1) ); in FDKcrcGetCRC()
404 HANDLE_FDK_CRCINFO hCrcInfo, in crcCalc() argument
409 USHORT crc = hCrcInfo->crcValue; in crcCalc()
410 CCrcRegData *rD = &hCrcInfo->crcRegData[reg]; in crcCalc()
434 if(hCrcInfo->pCrcLookup) { in crcCalc()
435 rBits -= (calcCrc_Bytes(&crc, hCrcInfo->pCrcLookup, &bsReader, words)<<3); in crcCalc()
438 rBits -= calcCrc_Bits(&crc, hCrcInfo->crcMask, hCrcInfo->crcPoly, &bsReader, words<<3 ); in crcCalc()
443 rBits -= calcCrc_Bits(&crc, hCrcInfo->crcMask, hCrcInfo->crcPoly, &bsReader, mBits ); in crcCalc()
448 if ( (hCrcInfo->pCrcLookup) && (rBits>8) ) { in crcCalc()
449 rBits -= (calcCrc_Bytes(&crc, hCrcInfo->pCrcLookup, NULL, rBits>>3)<<3); in crcCalc()
453 rBits -= calcCrc_Bits(&crc, hCrcInfo->crcMask, hCrcInfo->crcPoly, NULL, rBits ); in crcCalc()
457 hCrcInfo->crcValue = crc; in crcCalc()