144961713Sgirish /*
244961713Sgirish  * CDDL HEADER START
344961713Sgirish  *
444961713Sgirish  * The contents of this file are subject to the terms of the
544961713Sgirish  * Common Development and Distribution License (the "License").
644961713Sgirish  * You may not use this file except in compliance with the License.
744961713Sgirish  *
844961713Sgirish  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
944961713Sgirish  * or http://www.opensolaris.org/os/licensing.
1044961713Sgirish  * See the License for the specific language governing permissions
1144961713Sgirish  * and limitations under the License.
1244961713Sgirish  *
1344961713Sgirish  * When distributing Covered Code, include this CDDL HEADER in each
1444961713Sgirish  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1544961713Sgirish  * If applicable, add the following below this CDDL HEADER, with the
1644961713Sgirish  * fields enclosed by brackets "[]" replaced with your own identifying
1744961713Sgirish  * information: Portions Copyright [yyyy] [name of copyright owner]
1844961713Sgirish  *
1944961713Sgirish  * CDDL HEADER END
2044961713Sgirish  */
2144961713Sgirish /*
2244961713Sgirish  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2344961713Sgirish  * Use is subject to license terms.
2444961713Sgirish  */
2544961713Sgirish 
2644961713Sgirish #ifndef _SYS_NXGE_NXGE_CRC_H
2744961713Sgirish #define	_SYS_NXGE_NXGE_CRC_H
2844961713Sgirish 
2944961713Sgirish #ifdef __cplusplus
3044961713Sgirish extern "C" {
3144961713Sgirish #endif
3244961713Sgirish 
3344961713Sgirish void nxge_crc32c_init(void);
3444961713Sgirish uint32_t nxge_crc32c(uint32_t, const uint8_t *, int);
3544961713Sgirish 
3644961713Sgirish void nxge_crc_ccitt_init(void);
3744961713Sgirish uint16_t nxge_crc_ccitt(uint16_t, const uint8_t *, int);
3844961713Sgirish 
3944961713Sgirish uint32_t nxge_compute_h1_table1(uint32_t, uint32_t *, uint32_t);
4044961713Sgirish uint32_t nxge_compute_h1_table4(uint32_t, uint32_t *, uint32_t);
4144961713Sgirish uint32_t nxge_compute_h1_serial(uint32_t crcin, uint32_t *, uint32_t);
4244961713Sgirish 
4344961713Sgirish #define	nxge_compute_h2(cin, flow, len)			\
4444961713Sgirish 	nxge_crc_ccitt(cin, flow, len)
4544961713Sgirish 
4644961713Sgirish void nxge_init_h1_table(void);
4744961713Sgirish 
4844961713Sgirish #define	nxge_compute_h1(cin, flow, len)			\
4944961713Sgirish 	nxge_compute_h1_table4(cin, flow, len)
5044961713Sgirish 
5144961713Sgirish 
5244961713Sgirish #ifdef __cplusplus
5344961713Sgirish }
5444961713Sgirish #endif
5544961713Sgirish 
5644961713Sgirish #endif /* _SYS_NXGE_NXGE_CRC_H */
57