aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_nsc.c
diff options
context:
space:
mode:
authorKylene Hall <kjhall@us.ibm.com>2005-06-24 01:01:48 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:05:24 -0400
commit3122a88a242454efe72930e56a3e4d56ee534f3c (patch)
tree123d3c91c303d77702b392b7ac136312eb0b7ec2 /drivers/char/tpm/tpm_nsc.c
parent700d8bdcd0fa815b08638b1e4d43b66d60cc6a8d (diff)
[PATCH] tpm: Fix concerns with TPM driver -- use enums
Convert #defines to named enums where that preference has been indicated by other kernel developers. Signed-off-by: Kylene Hall <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/tpm/tpm_nsc.c')
-rw-r--r--drivers/char/tpm/tpm_nsc.c54
1 files changed, 31 insertions, 23 deletions
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
index 6e5ffcacea60..24832abe0b2d 100644
--- a/drivers/char/tpm/tpm_nsc.c
+++ b/drivers/char/tpm/tpm_nsc.c
@@ -22,34 +22,42 @@
22#include "tpm.h" 22#include "tpm.h"
23 23
24/* National definitions */ 24/* National definitions */
25#define TPM_NSC_BASE 0x360 25enum tpm_nsc_addr {
26#define TPM_NSC_IRQ 0x07 26 TPM_NSC_BASE = 0x360,
27 TPM_NSC_IRQ = 0x07
28};
27 29
28#define NSC_LDN_INDEX 0x07 30enum tpm_nsc_index {
29#define NSC_SID_INDEX 0x20 31 NSC_LDN_INDEX = 0x07,
30#define NSC_LDC_INDEX 0x30 32 NSC_SID_INDEX = 0x20,
31#define NSC_DIO_INDEX 0x60 33 NSC_LDC_INDEX = 0x30,
32#define NSC_CIO_INDEX 0x62 34 NSC_DIO_INDEX = 0x60,
33#define NSC_IRQ_INDEX 0x70 35 NSC_CIO_INDEX = 0x62,
34#define NSC_ITS_INDEX 0x71 36 NSC_IRQ_INDEX = 0x70,
37 NSC_ITS_INDEX = 0x71
38};
35 39
36#define NSC_STATUS 0x01 40enum tpm_nsc_status_loc {
37#define NSC_COMMAND 0x01 41 NSC_STATUS = 0x01,
38#define NSC_DATA 0x00 42 NSC_COMMAND = 0x01,
43 NSC_DATA = 0x00
44};
39 45
40/* status bits */ 46/* status bits */
41#define NSC_STATUS_OBF 0x01 /* output buffer full */ 47enum tpm_nsc_status{
42#define NSC_STATUS_IBF 0x02 /* input buffer full */ 48 NSC_STATUS_OBF = 0x01, /* output buffer full */
43#define NSC_STATUS_F0 0x04 /* F0 */ 49 NSC_STATUS_IBF = 0x02, /* input buffer full */
44#define NSC_STATUS_A2 0x08 /* A2 */ 50 NSC_STATUS_F0 = 0x04, /* F0 */
45#define NSC_STATUS_RDY 0x10 /* ready to receive command */ 51 NSC_STATUS_A2 = 0x08, /* A2 */
46#define NSC_STATUS_IBR 0x20 /* ready to receive data */ 52 NSC_STATUS_RDY = 0x10, /* ready to receive command */
47 53 NSC_STATUS_IBR = 0x20 /* ready to receive data */
54};
48/* command bits */ 55/* command bits */
49#define NSC_COMMAND_NORMAL 0x01 /* normal mode */ 56enum tpm_nsc_cmd_mode {
50#define NSC_COMMAND_EOC 0x03 57 NSC_COMMAND_NORMAL = 0x01, /* normal mode */
51#define NSC_COMMAND_CANCEL 0x22 58 NSC_COMMAND_EOC = 0x03,
52 59 NSC_COMMAND_CANCEL = 0x22
60};
53/* 61/*
54 * Wait for a certain status to appear 62 * Wait for a certain status to appear
55 */ 63 */