/**************************************************************************** * * * Copyright 2013-2013 NetApp Inc. All rights reserved. This file is * * confidential and a trade secret of NetApp Inc. The receipt or * * possession of this file does not convey any rights to reproduce or * * disclose its contents or to manufacture, use, or sell anything it may * * describe, in whole, or in part, without the specific written consent of * * LSI Corporation. * * * ****************************************************************************/ /**************************************************************************** * * * NAME ecc_stats.h * * SUMMARY This is the header file for ECC statistics. * * VERSION %version: % * * UPDATE DATE %date_modified: % * * PROGRAMMER %created_by: Ken Hu % * * * * Copyright 2013-2013 NetApp Inc. All Rights Reserved. * * * * DESCRIPTION: * * * ****************************************************************************/ #ifndef ECC_STATS_H #define ECC_STATS_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define ECC_STATISTICS_DRV_NAME "ecc_stats" /* Definition for ioctl */ #define ECC_STATISTICS_MAGIC_NUMBER 'i' #define ECC_STATISTICS_CMD_BASE 0x80 #define ECC_STATISTICS_CMD_SEQ_NUMBER(cmd) (ECC_STATISTICS_CMD_BASE | (cmd)) #define GET_ECC_STATISTICS_CMD(seq_num) ((seq_num) - ECC_STATISTICS_CMD_BASE) typedef enum { RESET_ECC_STATISTICS = 0, INSERT_ECC_STATISTICS_ENTRY, GET_ECC_STATISTICS_ENTRY, GET_NUMBER_OF_ECC_STATISTICS_ENTRIES, GET_NUMBER_OF_ECC_ERRORS, } ECC_STATISTICS_CONTROL_CMD; /* Definition for error code of getting ECC statistics entries */ typedef enum { GET_ENTRY_NO_ERROR = 0, INPUT_START_INDEX_GREATER_THAN_AMOUNT_OF_ENTRIES, INPUT_NUMBER_OF_ENTRIES_EXCEED_ECC_TABLE_RANGE, INPUT_ECC_STATISTICS_TABLE_IS_NULL, } ECC_STATISTICS_GET_ENTRY_ERRORCODE; /* Definition for ECC statistics entry */ typedef struct _ECC_STATS { UINT64 failingAddress; UINT32 sourceID; UINT64 badBit; UINT32 errorCount; } ECC_STATS, *PTR_ECC_STATS; typedef struct _ECC_STATS_ENTRY { ECC_STATS eccStats; struct _ECC_STATS_ENTRY* next; } ECC_STATS_ENTRY, *PTR_ECC_STATS_ENTRY; /* Definition for retrieving ECC statistics entry */ typedef struct _GET_ECC_STATS_INFO { UINT32 startIndex; ECC_STATS eccStats; } GET_ECC_STATS_INFO, *PTR_GET_ECC_STATS_INFO; /* ECC Interface Driver functions */ void add_ecc_stats_entry(const PTR_ECC_STATS inputECCStats); #endif // #ifndef ECC_STATS_H