mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
There is nothing chip-specific in the software CRC implementation. Let's move it to common so that we can reuse it for other chips and unit tests. BUG=chrome-os-partner:31200 TEST=Define CONFIG_SW_CRC for host. Check crc.c compiles fine. BRANCH=None Change-Id: Icdc1d105c55c38ff07410cb5d733a31dbac53aea Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/211494 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
28 lines
581 B
C
28 lines
581 B
C
/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef _CRC_H
|
|
#define _CRC_H
|
|
/* CRC-32 implementation with USB constants */
|
|
/* Note: it's a stateful CRC-32 to match the hardware block interface */
|
|
|
|
#ifdef CONFIG_HW_CRC
|
|
#include "crc_hw.h"
|
|
#else
|
|
|
|
/* Use software implementation */
|
|
|
|
void crc32_init(void);
|
|
|
|
void crc32_hash32(uint32_t val);
|
|
|
|
void crc32_hash16(uint16_t val);
|
|
|
|
uint32_t crc32_result(void);
|
|
|
|
#endif /* CONFIG_HW_CRC */
|
|
|
|
#endif /* _CRC_H */
|