/* SPDX-License-Identifier: GPL-2.0-only */
/* User-space adapters, not Linux ABI declarations. */
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
typedef uint8_t u8;
typedef uint16_t __be16;
typedef uint32_t __be32;
typedef uint64_t sector_t;
typedef int blk_status_t;
#define cpu_to_be16(x) htons(x)
#define cpu_to_be32(x) htonl(x)
#define be16_to_cpu(x) ntohs(x)
#define be32_to_cpu(x) ntohl(x)
#define lower_32_bits(x) ((uint32_t)(x))
#define BLK_INTEGRITY_REF_TAG 1
#define BLK_STS_OK 0
#define BLK_STS_PROTECTION 1
#define T10_PI_APP_ESCAPE cpu_to_be16(0xffff)
#define T10_PI_REF_ESCAPE cpu_to_be32(0xffffffff)
#define pr_err(...) ((void)0)
struct blk_integrity {
    u8 pi_offset;
    unsigned int flags;
    unsigned int tuple_size;
    unsigned char csum_type;
};
static unsigned int checksum_calls;
/* Deliberate oracle stub: isolate branching, not CRC correctness. */
static __be16 t10_pi_csum(__be16 previous, void *data, unsigned int len,
                         unsigned char type)
{
    (void)previous; (void)data; (void)len; (void)type;
    checksum_calls++;
    return cpu_to_be16(0x1234);
}
