Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
t10crc16.h File Reference

Go to the source code of this file.

Functions

unsigned short t10crc16 (const unsigned char *blk_adr, unsigned long blk_len, unsigned short crc)
 Calculate the T10 PI CRC guard value for a block. More...
 

Function Details

unsigned short t10crc16 ( const unsigned char *  blk_adr,
unsigned long  blk_len,
unsigned short  crc 
)

Calculate the T10 PI CRC guard value for a block.

Code based on Rocksoft's public domain CRC code, refer to http://www.ross.net/crc/download/crc_v3.txt. Minimally altered to work with the ocs_dif API.

Parameters
blk_adrPointer to the data buffer.
blk_lenNumber of bytes.
crcPreviously-calculated CRC, or crcseed for a new block.
Returns
Returns the calculated CRC, which may be passed back in for partial blocks.

Definition at line 120 of file t10crc16.c.