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

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...
 

Variables

static unsigned short crctable [256]
 

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.

Variable Details

unsigned short crctable[256]
static

Definition at line 64 of file t10crc16.c.