PebbleOS
Loading...
Searching...
No Matches
Functions

Hardware CRC acceleration used by CRC. More...

Functions

size_t pbl_crc_hw_crc32 (uint32_t *crc, const void *data, size_t len)
 Accelerated CRC-32/ISO-HDLC.
 
size_t pbl_crc_hw_crc32_legacy (uint32_t *reg, const void *data, size_t len)
 Accelerated legacy checksum.
 

Detailed Description

Hardware CRC acceleration used by CRC.

Provided by drivers that select CRC_HW_ACCEL.

Each function processes a prefix of the data, a whole number of 32-bit words, and returns its length in bytes. It returns 0 without touching the running value when the hardware cannot take the request; the CRC subsystem computes whatever is left in software.

Function Documentation

◆ pbl_crc_hw_crc32()

size_t pbl_crc_hw_crc32 ( uint32_t *  crc,
const void *  data,
size_t  len 
)

Accelerated CRC-32/ISO-HDLC.

Parameters
[in,out]crcRunning CRC-32/ISO-HDLC value, as passed to pbl_crc32().
dataData to process.
lenLength of data in bytes.
Returns
Number of bytes processed, a multiple of 4.

◆ pbl_crc_hw_crc32_legacy()

size_t pbl_crc_hw_crc32_legacy ( uint32_t *  reg,
const void *  data,
size_t  len 
)

Accelerated legacy checksum.

Parameters
[in,out]regRunning legacy checksum register, see struct pbl_crc32_legacy.
dataData to process, as little-endian 32-bit words.
lenLength of data in bytes.
Returns
Number of bytes processed, a multiple of 4.