summaryrefslogtreecommitdiffstats
path: root/include/linux/hdsmart.h
blob: 10bd7249d8e0fae533cc6c3f91a09bf2941a730b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef _LINUX_HDSMART_H
#define _LINUX_HDSMART_H

/*
 * This file contains some defines for the AT-hd-controller.
 * Various sources.  
 */

#define NR_ATTRIBUTES	30

typedef struct threshold_s {
	unsigned char	id;
	unsigned char	threshold;
	unsigned char	reserved[10];
} __attribute__ ((packed)) threshold_t;

typedef struct thresholds_s {
	unsigned short	revision;
	threshold_t	thresholds[NR_ATTRIBUTES];
	unsigned char	reserved[18];
	unsigned char	vendor[131];
	unsigned char	checksum;
} __attribute__ ((packed)) thresholds_t;

typedef struct value_s {
	unsigned char	id;
	unsigned short	status;
	unsigned char	value;
	unsigned char	vendor[8];
} __attribute__ ((packed)) value_t;

typedef struct values_s {
	unsigned short	revision;
	value_t		values[NR_ATTRIBUTES];
	unsigned char	offline_status;
	unsigned char	vendor1;
	unsigned short	offline_timeout;
	unsigned char	vendor2;
	unsigned char	offline_capability;
	unsigned short	smart_capability;
	unsigned char	reserved[16];
	unsigned char	vendor[125];
	unsigned char	checksum;
} __attribute__ ((packed)) values_t;

#if !defined(__KERNEL__) || defined(_IDE_DISK_C)
 
#define NR_OFFLINE_TEXTS	5
struct {
	unsigned char	value;
	char		*text;
} offline_status_text[NR_OFFLINE_TEXTS] = {
	{ 0x00, "NeverStarted" },
	{ 0x02, "Completed" },
	{ 0x04, "Suspended" },
	{ 0x05, "Aborted" },
	{ 0x06, "Failed" }
};
#endif /* !defined(__KERNEL__) || defined(_IDE_DISK_C) */

#endif	/* _LINUX_HDSMART_H */