Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2004 IBM Corporation |
| 3 | * |
| 4 | * Authors: |
| 5 | * Leendert van Doorn <leendert@watson.ibm.com> |
| 6 | * Dave Safford <safford@watson.ibm.com> |
| 7 | * Reiner Sailer <sailer@watson.ibm.com> |
| 8 | * Kylene Hall <kjhall@us.ibm.com> |
| 9 | * |
| 10 | * Maintained by: <tpmdd_devel@lists.sourceforge.net> |
| 11 | * |
| 12 | * Device driver for TCG/TCPA TPM (trusted platform module). |
| 13 | * Specifications at www.trustedcomputinggroup.org |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or |
| 16 | * modify it under the terms of the GNU General Public License as |
| 17 | * published by the Free Software Foundation, version 2 of the |
| 18 | * License. |
| 19 | * |
| 20 | * Note, the TPM chip is not interrupt driven (only polling) |
| 21 | * and can have very long timeouts (minutes!). Hence the unusual |
Nishanth Aravamudan | 700d8bd | 2005-06-23 22:01:47 -0700 | [diff] [blame] | 22 | * calls to msleep. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | * |
| 24 | */ |
| 25 | |
| 26 | #include <linux/sched.h> |
| 27 | #include <linux/poll.h> |
| 28 | #include <linux/spinlock.h> |
| 29 | #include "tpm.h" |
| 30 | |
Kylene Hall | 3122a88 | 2005-06-23 22:01:48 -0700 | [diff] [blame] | 31 | enum tpm_const { |
| 32 | TPM_MINOR = 224, /* officially assigned */ |
| 33 | TPM_BUFSIZE = 2048, |
| 34 | TPM_NUM_DEVICES = 256, |
| 35 | TPM_NUM_MASK_ENTRIES = TPM_NUM_DEVICES / (8 * sizeof(int)) |
| 36 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | static LIST_HEAD(tpm_chip_list); |
| 39 | static DEFINE_SPINLOCK(driver_lock); |
Kylene Hall | 3122a88 | 2005-06-23 22:01:48 -0700 | [diff] [blame] | 40 | static int dev_mask[TPM_NUM_MASK_ENTRIES]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
| 42 | static void user_reader_timeout(unsigned long ptr) |
| 43 | { |
| 44 | struct tpm_chip *chip = (struct tpm_chip *) ptr; |
| 45 | |
Kylene Jo Hall | 09e12f9 | 2005-11-13 16:07:43 -0800 | [diff] [blame] | 46 | schedule_work(&chip->work); |
| 47 | } |
| 48 | |
| 49 | static void timeout_work(void * ptr) |
| 50 | { |
| 51 | struct tpm_chip *chip = ptr; |
| 52 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | down(&chip->buffer_mutex); |
| 54 | atomic_set(&chip->data_pending, 0); |
| 55 | memset(chip->data_buffer, 0, TPM_BUFSIZE); |
| 56 | up(&chip->buffer_mutex); |
| 57 | } |
| 58 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | * Internal kernel interface to transmit TPM commands |
| 61 | */ |
| 62 | static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, |
| 63 | size_t bufsiz) |
| 64 | { |
Kylene Hall | d9e5b6b | 2005-06-23 22:02:02 -0700 | [diff] [blame] | 65 | ssize_t rc; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | u32 count; |
Nishanth Aravamudan | 700d8bd | 2005-06-23 22:01:47 -0700 | [diff] [blame] | 67 | unsigned long stop; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | |
Kylene Hall | 81179bb | 2005-06-23 22:01:59 -0700 | [diff] [blame] | 69 | count = be32_to_cpu(*((__be32 *) (buf + 2))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
| 71 | if (count == 0) |
| 72 | return -ENODATA; |
| 73 | if (count > bufsiz) { |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 74 | dev_err(chip->dev, |
Al Viro | b76be68 | 2005-04-26 07:43:41 -0700 | [diff] [blame] | 75 | "invalid count value %x %zx \n", count, bufsiz); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | return -E2BIG; |
| 77 | } |
| 78 | |
| 79 | down(&chip->tpm_mutex); |
| 80 | |
Kylene Hall | d9e5b6b | 2005-06-23 22:02:02 -0700 | [diff] [blame] | 81 | if ((rc = chip->vendor->send(chip, (u8 *) buf, count)) < 0) { |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 82 | dev_err(chip->dev, |
Kylene Hall | d9e5b6b | 2005-06-23 22:02:02 -0700 | [diff] [blame] | 83 | "tpm_transmit: tpm_send: error %zd\n", rc); |
| 84 | goto out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | } |
| 86 | |
Nishanth Aravamudan | 700d8bd | 2005-06-23 22:01:47 -0700 | [diff] [blame] | 87 | stop = jiffies + 2 * 60 * HZ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | do { |
Kylene Jo Hall | b4ed3e3 | 2005-10-30 15:03:23 -0800 | [diff] [blame] | 89 | u8 status = chip->vendor->status(chip); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | if ((status & chip->vendor->req_complete_mask) == |
| 91 | chip->vendor->req_complete_val) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | goto out_recv; |
| 93 | } |
Kylene Hall | d9e5b6b | 2005-06-23 22:02:02 -0700 | [diff] [blame] | 94 | |
| 95 | if ((status == chip->vendor->req_canceled)) { |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 96 | dev_err(chip->dev, "Operation Canceled\n"); |
Kylene Hall | d9e5b6b | 2005-06-23 22:02:02 -0700 | [diff] [blame] | 97 | rc = -ECANCELED; |
| 98 | goto out; |
| 99 | } |
| 100 | |
| 101 | msleep(TPM_TIMEOUT); /* CHECK */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | rmb(); |
Nishanth Aravamudan | 700d8bd | 2005-06-23 22:01:47 -0700 | [diff] [blame] | 103 | } while (time_before(jiffies, stop)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | |
| 105 | |
| 106 | chip->vendor->cancel(chip); |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 107 | dev_err(chip->dev, "Operation Timed out\n"); |
Kylene Hall | d9e5b6b | 2005-06-23 22:02:02 -0700 | [diff] [blame] | 108 | rc = -ETIME; |
| 109 | goto out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | |
| 111 | out_recv: |
Kylene Hall | d9e5b6b | 2005-06-23 22:02:02 -0700 | [diff] [blame] | 112 | rc = chip->vendor->recv(chip, (u8 *) buf, bufsiz); |
| 113 | if (rc < 0) |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 114 | dev_err(chip->dev, |
Kylene Hall | d9e5b6b | 2005-06-23 22:02:02 -0700 | [diff] [blame] | 115 | "tpm_transmit: tpm_recv: error %zd\n", rc); |
| 116 | out: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | up(&chip->tpm_mutex); |
Kylene Hall | d9e5b6b | 2005-06-23 22:02:02 -0700 | [diff] [blame] | 118 | return rc; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | #define TPM_DIGEST_SIZE 20 |
| 122 | #define CAP_PCR_RESULT_SIZE 18 |
Kylene Hall | dff37e4 | 2005-06-23 22:01:50 -0700 | [diff] [blame] | 123 | static const u8 cap_pcr[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | 0, 193, /* TPM_TAG_RQU_COMMAND */ |
| 125 | 0, 0, 0, 22, /* length */ |
| 126 | 0, 0, 0, 101, /* TPM_ORD_GetCapability */ |
| 127 | 0, 0, 0, 5, |
| 128 | 0, 0, 0, 4, |
| 129 | 0, 0, 1, 1 |
| 130 | }; |
| 131 | |
| 132 | #define READ_PCR_RESULT_SIZE 30 |
Kylene Hall | dff37e4 | 2005-06-23 22:01:50 -0700 | [diff] [blame] | 133 | static const u8 pcrread[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | 0, 193, /* TPM_TAG_RQU_COMMAND */ |
| 135 | 0, 0, 0, 14, /* length */ |
| 136 | 0, 0, 0, 21, /* TPM_ORD_PcrRead */ |
| 137 | 0, 0, 0, 0 /* PCR index */ |
| 138 | }; |
| 139 | |
Kylene Hall | 6659ca2 | 2005-06-23 22:02:00 -0700 | [diff] [blame] | 140 | ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr, |
| 141 | char *buf) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | { |
| 143 | u8 data[READ_PCR_RESULT_SIZE]; |
| 144 | ssize_t len; |
Kylene Hall | 81179bb | 2005-06-23 22:01:59 -0700 | [diff] [blame] | 145 | int i, j, num_pcrs; |
| 146 | __be32 index; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | char *str = buf; |
| 148 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 149 | struct tpm_chip *chip = dev_get_drvdata(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | if (chip == NULL) |
| 151 | return -ENODEV; |
| 152 | |
| 153 | memcpy(data, cap_pcr, sizeof(cap_pcr)); |
| 154 | if ((len = tpm_transmit(chip, data, sizeof(data))) |
Kylene Hall | e234bc9 | 2005-06-23 22:02:08 -0700 | [diff] [blame] | 155 | < CAP_PCR_RESULT_SIZE) { |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 156 | dev_dbg(chip->dev, "A TPM error (%d) occurred " |
Kylene Hall | e234bc9 | 2005-06-23 22:02:08 -0700 | [diff] [blame] | 157 | "attempting to determine the number of PCRS\n", |
| 158 | be32_to_cpu(*((__be32 *) (data + 6)))); |
| 159 | return 0; |
| 160 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | |
Kylene Hall | 81179bb | 2005-06-23 22:01:59 -0700 | [diff] [blame] | 162 | num_pcrs = be32_to_cpu(*((__be32 *) (data + 14))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | |
| 164 | for (i = 0; i < num_pcrs; i++) { |
| 165 | memcpy(data, pcrread, sizeof(pcrread)); |
| 166 | index = cpu_to_be32(i); |
| 167 | memcpy(data + 10, &index, 4); |
| 168 | if ((len = tpm_transmit(chip, data, sizeof(data))) |
Kylene Hall | e234bc9 | 2005-06-23 22:02:08 -0700 | [diff] [blame] | 169 | < READ_PCR_RESULT_SIZE){ |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 170 | dev_dbg(chip->dev, "A TPM error (%d) occurred" |
Kylene Hall | e234bc9 | 2005-06-23 22:02:08 -0700 | [diff] [blame] | 171 | " attempting to read PCR %d of %d\n", |
Andrew Morton | b888c87 | 2005-10-30 15:03:28 -0800 | [diff] [blame] | 172 | be32_to_cpu(*((__be32 *) (data + 6))), |
| 173 | i, num_pcrs); |
Kylene Hall | e234bc9 | 2005-06-23 22:02:08 -0700 | [diff] [blame] | 174 | goto out; |
| 175 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | str += sprintf(str, "PCR-%02d: ", i); |
| 177 | for (j = 0; j < TPM_DIGEST_SIZE; j++) |
| 178 | str += sprintf(str, "%02X ", *(data + 10 + j)); |
| 179 | str += sprintf(str, "\n"); |
| 180 | } |
Kylene Hall | e234bc9 | 2005-06-23 22:02:08 -0700 | [diff] [blame] | 181 | out: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | return str - buf; |
| 183 | } |
Kylene Hall | 6659ca2 | 2005-06-23 22:02:00 -0700 | [diff] [blame] | 184 | EXPORT_SYMBOL_GPL(tpm_show_pcrs); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | |
| 186 | #define READ_PUBEK_RESULT_SIZE 314 |
Kylene Hall | dff37e4 | 2005-06-23 22:01:50 -0700 | [diff] [blame] | 187 | static const u8 readpubek[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | 0, 193, /* TPM_TAG_RQU_COMMAND */ |
| 189 | 0, 0, 0, 30, /* length */ |
| 190 | 0, 0, 0, 124, /* TPM_ORD_ReadPubek */ |
| 191 | }; |
| 192 | |
Kylene Hall | 6659ca2 | 2005-06-23 22:02:00 -0700 | [diff] [blame] | 193 | ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr, |
| 194 | char *buf) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 195 | { |
Kylene Hall | 2df7111 | 2005-06-23 22:01:54 -0700 | [diff] [blame] | 196 | u8 *data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | ssize_t len; |
Kylene Hall | 81179bb | 2005-06-23 22:01:59 -0700 | [diff] [blame] | 198 | int i, rc; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 199 | char *str = buf; |
| 200 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 201 | struct tpm_chip *chip = dev_get_drvdata(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | if (chip == NULL) |
| 203 | return -ENODEV; |
| 204 | |
Andrew Morton | b888c87 | 2005-10-30 15:03:28 -0800 | [diff] [blame] | 205 | data = kzalloc(READ_PUBEK_RESULT_SIZE, GFP_KERNEL); |
Kylene Hall | 2df7111 | 2005-06-23 22:01:54 -0700 | [diff] [blame] | 206 | if (!data) |
| 207 | return -ENOMEM; |
| 208 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 209 | memcpy(data, readpubek, sizeof(readpubek)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | |
Kylene Hall | 2df7111 | 2005-06-23 22:01:54 -0700 | [diff] [blame] | 211 | if ((len = tpm_transmit(chip, data, READ_PUBEK_RESULT_SIZE)) < |
| 212 | READ_PUBEK_RESULT_SIZE) { |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 213 | dev_dbg(chip->dev, "A TPM error (%d) occurred " |
Kylene Hall | e234bc9 | 2005-06-23 22:02:08 -0700 | [diff] [blame] | 214 | "attempting to read the PUBEK\n", |
| 215 | be32_to_cpu(*((__be32 *) (data + 6)))); |
Kylene Jo Hall | 34d6e07 | 2005-06-23 22:02:10 -0700 | [diff] [blame] | 216 | rc = 0; |
| 217 | goto out; |
Kylene Hall | 2df7111 | 2005-06-23 22:01:54 -0700 | [diff] [blame] | 218 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 219 | |
| 220 | /* |
| 221 | ignore header 10 bytes |
| 222 | algorithm 32 bits (1 == RSA ) |
| 223 | encscheme 16 bits |
| 224 | sigscheme 16 bits |
| 225 | parameters (RSA 12->bytes: keybit, #primes, expbit) |
| 226 | keylenbytes 32 bits |
| 227 | 256 byte modulus |
| 228 | ignore checksum 20 bytes |
| 229 | */ |
| 230 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | str += |
| 232 | sprintf(str, |
| 233 | "Algorithm: %02X %02X %02X %02X\nEncscheme: %02X %02X\n" |
| 234 | "Sigscheme: %02X %02X\nParameters: %02X %02X %02X %02X" |
| 235 | " %02X %02X %02X %02X %02X %02X %02X %02X\n" |
| 236 | "Modulus length: %d\nModulus: \n", |
| 237 | data[10], data[11], data[12], data[13], data[14], |
| 238 | data[15], data[16], data[17], data[22], data[23], |
| 239 | data[24], data[25], data[26], data[27], data[28], |
| 240 | data[29], data[30], data[31], data[32], data[33], |
Kylene Jo Hall | 1dda8ab | 2005-06-25 14:55:40 -0700 | [diff] [blame] | 241 | be32_to_cpu(*((__be32 *) (data + 34)))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 242 | |
| 243 | for (i = 0; i < 256; i++) { |
Kylene Jo Hall | 1dda8ab | 2005-06-25 14:55:40 -0700 | [diff] [blame] | 244 | str += sprintf(str, "%02X ", data[i + 38]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | if ((i + 1) % 16 == 0) |
| 246 | str += sprintf(str, "\n"); |
| 247 | } |
Kylene Hall | 2df7111 | 2005-06-23 22:01:54 -0700 | [diff] [blame] | 248 | rc = str - buf; |
Kylene Jo Hall | 34d6e07 | 2005-06-23 22:02:10 -0700 | [diff] [blame] | 249 | out: |
Kylene Hall | 2df7111 | 2005-06-23 22:01:54 -0700 | [diff] [blame] | 250 | kfree(data); |
| 251 | return rc; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | } |
Kylene Hall | 6659ca2 | 2005-06-23 22:02:00 -0700 | [diff] [blame] | 253 | EXPORT_SYMBOL_GPL(tpm_show_pubek); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | |
| 255 | #define CAP_VER_RESULT_SIZE 18 |
Kylene Hall | dff37e4 | 2005-06-23 22:01:50 -0700 | [diff] [blame] | 256 | static const u8 cap_version[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | 0, 193, /* TPM_TAG_RQU_COMMAND */ |
| 258 | 0, 0, 0, 18, /* length */ |
| 259 | 0, 0, 0, 101, /* TPM_ORD_GetCapability */ |
| 260 | 0, 0, 0, 6, |
| 261 | 0, 0, 0, 0 |
| 262 | }; |
| 263 | |
| 264 | #define CAP_MANUFACTURER_RESULT_SIZE 18 |
Kylene Hall | dff37e4 | 2005-06-23 22:01:50 -0700 | [diff] [blame] | 265 | static const u8 cap_manufacturer[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | 0, 193, /* TPM_TAG_RQU_COMMAND */ |
| 267 | 0, 0, 0, 22, /* length */ |
| 268 | 0, 0, 0, 101, /* TPM_ORD_GetCapability */ |
| 269 | 0, 0, 0, 5, |
| 270 | 0, 0, 0, 4, |
| 271 | 0, 0, 1, 3 |
| 272 | }; |
| 273 | |
Kylene Hall | 6659ca2 | 2005-06-23 22:02:00 -0700 | [diff] [blame] | 274 | ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr, |
| 275 | char *buf) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | { |
Kylene Hall | 2df7111 | 2005-06-23 22:01:54 -0700 | [diff] [blame] | 277 | u8 data[sizeof(cap_manufacturer)]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 278 | ssize_t len; |
| 279 | char *str = buf; |
| 280 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 281 | struct tpm_chip *chip = dev_get_drvdata(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | if (chip == NULL) |
| 283 | return -ENODEV; |
| 284 | |
| 285 | memcpy(data, cap_manufacturer, sizeof(cap_manufacturer)); |
| 286 | |
| 287 | if ((len = tpm_transmit(chip, data, sizeof(data))) < |
| 288 | CAP_MANUFACTURER_RESULT_SIZE) |
| 289 | return len; |
| 290 | |
| 291 | str += sprintf(str, "Manufacturer: 0x%x\n", |
Kylene Hall | 81179bb | 2005-06-23 22:01:59 -0700 | [diff] [blame] | 292 | be32_to_cpu(*((__be32 *) (data + 14)))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | |
| 294 | memcpy(data, cap_version, sizeof(cap_version)); |
| 295 | |
| 296 | if ((len = tpm_transmit(chip, data, sizeof(data))) < |
| 297 | CAP_VER_RESULT_SIZE) |
| 298 | return len; |
| 299 | |
| 300 | str += |
| 301 | sprintf(str, "TCG version: %d.%d\nFirmware version: %d.%d\n", |
| 302 | (int) data[14], (int) data[15], (int) data[16], |
| 303 | (int) data[17]); |
| 304 | |
| 305 | return str - buf; |
| 306 | } |
Kylene Hall | 6659ca2 | 2005-06-23 22:02:00 -0700 | [diff] [blame] | 307 | EXPORT_SYMBOL_GPL(tpm_show_caps); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | |
Kylene Hall | 6659ca2 | 2005-06-23 22:02:00 -0700 | [diff] [blame] | 309 | ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, |
| 310 | const char *buf, size_t count) |
| 311 | { |
| 312 | struct tpm_chip *chip = dev_get_drvdata(dev); |
| 313 | if (chip == NULL) |
| 314 | return 0; |
| 315 | |
| 316 | chip->vendor->cancel(chip); |
| 317 | return count; |
| 318 | } |
| 319 | EXPORT_SYMBOL_GPL(tpm_store_cancel); |
| 320 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 321 | /* |
| 322 | * Device file system interface to the TPM |
| 323 | */ |
| 324 | int tpm_open(struct inode *inode, struct file *file) |
| 325 | { |
| 326 | int rc = 0, minor = iminor(inode); |
| 327 | struct tpm_chip *chip = NULL, *pos; |
| 328 | |
| 329 | spin_lock(&driver_lock); |
| 330 | |
| 331 | list_for_each_entry(pos, &tpm_chip_list, list) { |
| 332 | if (pos->vendor->miscdev.minor == minor) { |
| 333 | chip = pos; |
| 334 | break; |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | if (chip == NULL) { |
| 339 | rc = -ENODEV; |
| 340 | goto err_out; |
| 341 | } |
| 342 | |
| 343 | if (chip->num_opens) { |
Andrew Morton | b888c87 | 2005-10-30 15:03:28 -0800 | [diff] [blame] | 344 | dev_dbg(chip->dev, "Another process owns this TPM\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 345 | rc = -EBUSY; |
| 346 | goto err_out; |
| 347 | } |
| 348 | |
| 349 | chip->num_opens++; |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 350 | get_device(chip->dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 351 | |
| 352 | spin_unlock(&driver_lock); |
| 353 | |
| 354 | chip->data_buffer = kmalloc(TPM_BUFSIZE * sizeof(u8), GFP_KERNEL); |
| 355 | if (chip->data_buffer == NULL) { |
| 356 | chip->num_opens--; |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 357 | put_device(chip->dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 358 | return -ENOMEM; |
| 359 | } |
| 360 | |
| 361 | atomic_set(&chip->data_pending, 0); |
| 362 | |
| 363 | file->private_data = chip; |
| 364 | return 0; |
| 365 | |
| 366 | err_out: |
| 367 | spin_unlock(&driver_lock); |
| 368 | return rc; |
| 369 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | EXPORT_SYMBOL_GPL(tpm_open); |
| 371 | |
| 372 | int tpm_release(struct inode *inode, struct file *file) |
| 373 | { |
| 374 | struct tpm_chip *chip = file->private_data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 375 | |
| 376 | spin_lock(&driver_lock); |
Kylene Hall | 5e976d5 | 2005-06-23 22:02:03 -0700 | [diff] [blame] | 377 | file->private_data = NULL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | chip->num_opens--; |
Kylene Hall | fe3fd483 | 2005-06-23 22:01:56 -0700 | [diff] [blame] | 379 | del_singleshot_timer_sync(&chip->user_read_timer); |
Kylene Jo Hall | ba39611 | 2005-11-18 01:10:57 -0800 | [diff] [blame] | 380 | flush_scheduled_work(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 381 | atomic_set(&chip->data_pending, 0); |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 382 | put_device(chip->dev); |
Kylene Hall | 5e976d5 | 2005-06-23 22:02:03 -0700 | [diff] [blame] | 383 | kfree(chip->data_buffer); |
| 384 | spin_unlock(&driver_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 385 | return 0; |
| 386 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 387 | EXPORT_SYMBOL_GPL(tpm_release); |
| 388 | |
Andrew Morton | b888c87 | 2005-10-30 15:03:28 -0800 | [diff] [blame] | 389 | ssize_t tpm_write(struct file *file, const char __user *buf, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 390 | size_t size, loff_t * off) |
| 391 | { |
| 392 | struct tpm_chip *chip = file->private_data; |
| 393 | int in_size = size, out_size; |
| 394 | |
| 395 | /* cannot perform a write until the read has cleared |
| 396 | either via tpm_read or a user_read_timer timeout */ |
Nishanth Aravamudan | 700d8bd | 2005-06-23 22:01:47 -0700 | [diff] [blame] | 397 | while (atomic_read(&chip->data_pending) != 0) |
| 398 | msleep(TPM_TIMEOUT); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 399 | |
| 400 | down(&chip->buffer_mutex); |
| 401 | |
| 402 | if (in_size > TPM_BUFSIZE) |
| 403 | in_size = TPM_BUFSIZE; |
| 404 | |
| 405 | if (copy_from_user |
| 406 | (chip->data_buffer, (void __user *) buf, in_size)) { |
| 407 | up(&chip->buffer_mutex); |
| 408 | return -EFAULT; |
| 409 | } |
| 410 | |
| 411 | /* atomic tpm command send and result receive */ |
| 412 | out_size = tpm_transmit(chip, chip->data_buffer, TPM_BUFSIZE); |
| 413 | |
| 414 | atomic_set(&chip->data_pending, out_size); |
| 415 | up(&chip->buffer_mutex); |
| 416 | |
| 417 | /* Set a timeout by which the reader must come claim the result */ |
Kylene Hall | fe3fd483 | 2005-06-23 22:01:56 -0700 | [diff] [blame] | 418 | mod_timer(&chip->user_read_timer, jiffies + (60 * HZ)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 419 | |
| 420 | return in_size; |
| 421 | } |
| 422 | |
| 423 | EXPORT_SYMBOL_GPL(tpm_write); |
| 424 | |
Andrew Morton | b888c87 | 2005-10-30 15:03:28 -0800 | [diff] [blame] | 425 | ssize_t tpm_read(struct file * file, char __user *buf, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 426 | size_t size, loff_t * off) |
| 427 | { |
| 428 | struct tpm_chip *chip = file->private_data; |
Kylene Hall | 5b44bd5 | 2005-06-23 22:01:53 -0700 | [diff] [blame] | 429 | int ret_size; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 430 | |
Kylene Hall | 5b44bd5 | 2005-06-23 22:01:53 -0700 | [diff] [blame] | 431 | del_singleshot_timer_sync(&chip->user_read_timer); |
Kylene Jo Hall | ba39611 | 2005-11-18 01:10:57 -0800 | [diff] [blame] | 432 | flush_scheduled_work(); |
Kylene Hall | 5b44bd5 | 2005-06-23 22:01:53 -0700 | [diff] [blame] | 433 | ret_size = atomic_read(&chip->data_pending); |
| 434 | atomic_set(&chip->data_pending, 0); |
| 435 | if (ret_size > 0) { /* relay data */ |
| 436 | if (size < ret_size) |
| 437 | ret_size = size; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 438 | |
| 439 | down(&chip->buffer_mutex); |
Kylene Jo Hall | f6a2382 | 2005-11-13 16:07:42 -0800 | [diff] [blame] | 440 | if (copy_to_user(buf, chip->data_buffer, ret_size)) |
Kylene Hall | 5b44bd5 | 2005-06-23 22:01:53 -0700 | [diff] [blame] | 441 | ret_size = -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 442 | up(&chip->buffer_mutex); |
| 443 | } |
| 444 | |
| 445 | return ret_size; |
| 446 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 447 | EXPORT_SYMBOL_GPL(tpm_read); |
| 448 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 449 | void tpm_remove_hardware(struct device *dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 450 | { |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 451 | struct tpm_chip *chip = dev_get_drvdata(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 452 | |
| 453 | if (chip == NULL) { |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 454 | dev_err(dev, "No device data found\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 455 | return; |
| 456 | } |
| 457 | |
| 458 | spin_lock(&driver_lock); |
| 459 | |
| 460 | list_del(&chip->list); |
| 461 | |
| 462 | spin_unlock(&driver_lock); |
| 463 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 464 | dev_set_drvdata(dev, NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 465 | misc_deregister(&chip->vendor->miscdev); |
Kylene Jo Hall | 9a936eb | 2005-06-30 02:58:50 -0700 | [diff] [blame] | 466 | kfree(chip->vendor->miscdev.name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 467 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 468 | sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); |
Kylene Jo Hall | 55a82ab | 2006-01-08 01:03:15 -0800 | [diff] [blame] | 469 | tpm_bios_log_teardown(chip->bios_dir); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 470 | |
Andrew Morton | b888c87 | 2005-10-30 15:03:28 -0800 | [diff] [blame] | 471 | dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= |
Kylene Jo Hall | f6a2382 | 2005-11-13 16:07:42 -0800 | [diff] [blame] | 472 | ~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 473 | |
| 474 | kfree(chip); |
| 475 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 476 | put_device(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 477 | } |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 478 | EXPORT_SYMBOL_GPL(tpm_remove_hardware); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | |
| 480 | static u8 savestate[] = { |
| 481 | 0, 193, /* TPM_TAG_RQU_COMMAND */ |
| 482 | 0, 0, 0, 10, /* blob length (in bytes) */ |
| 483 | 0, 0, 0, 152 /* TPM_ORD_SaveState */ |
| 484 | }; |
| 485 | |
| 486 | /* |
| 487 | * We are about to suspend. Save the TPM state |
| 488 | * so that it can be restored. |
| 489 | */ |
Kylene Jo Hall | ce2c87d | 2005-10-30 15:03:25 -0800 | [diff] [blame] | 490 | int tpm_pm_suspend(struct device *dev, pm_message_t pm_state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 491 | { |
Kylene Jo Hall | ce2c87d | 2005-10-30 15:03:25 -0800 | [diff] [blame] | 492 | struct tpm_chip *chip = dev_get_drvdata(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 493 | if (chip == NULL) |
| 494 | return -ENODEV; |
| 495 | |
| 496 | tpm_transmit(chip, savestate, sizeof(savestate)); |
| 497 | return 0; |
| 498 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 499 | EXPORT_SYMBOL_GPL(tpm_pm_suspend); |
| 500 | |
| 501 | /* |
| 502 | * Resume from a power safe. The BIOS already restored |
| 503 | * the TPM state. |
| 504 | */ |
Kylene Jo Hall | ce2c87d | 2005-10-30 15:03:25 -0800 | [diff] [blame] | 505 | int tpm_pm_resume(struct device *dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 506 | { |
Kylene Jo Hall | ce2c87d | 2005-10-30 15:03:25 -0800 | [diff] [blame] | 507 | struct tpm_chip *chip = dev_get_drvdata(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 508 | |
| 509 | if (chip == NULL) |
| 510 | return -ENODEV; |
| 511 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 512 | return 0; |
| 513 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 514 | EXPORT_SYMBOL_GPL(tpm_pm_resume); |
| 515 | |
| 516 | /* |
| 517 | * Called from tpm_<specific>.c probe function only for devices |
| 518 | * the driver has determined it should claim. Prior to calling |
| 519 | * this function the specific probe function has called pci_enable_device |
| 520 | * upon errant exit from this function specific probe function should call |
| 521 | * pci_disable_device |
| 522 | */ |
Andrew Morton | b888c87 | 2005-10-30 15:03:28 -0800 | [diff] [blame] | 523 | int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 524 | { |
Kylene Jo Hall | 6f9becc | 2005-06-25 14:55:41 -0700 | [diff] [blame] | 525 | #define DEVNAME_SIZE 7 |
| 526 | |
| 527 | char *devname; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 528 | struct tpm_chip *chip; |
| 529 | int i, j; |
| 530 | |
| 531 | /* Driver specific per-device data */ |
Andrew Morton | b888c87 | 2005-10-30 15:03:28 -0800 | [diff] [blame] | 532 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 533 | if (chip == NULL) |
| 534 | return -ENOMEM; |
| 535 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 536 | init_MUTEX(&chip->buffer_mutex); |
| 537 | init_MUTEX(&chip->tpm_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 538 | INIT_LIST_HEAD(&chip->list); |
| 539 | |
Kylene Jo Hall | 09e12f9 | 2005-11-13 16:07:43 -0800 | [diff] [blame] | 540 | INIT_WORK(&chip->work, timeout_work, chip); |
| 541 | |
Kylene Hall | fe3fd483 | 2005-06-23 22:01:56 -0700 | [diff] [blame] | 542 | init_timer(&chip->user_read_timer); |
| 543 | chip->user_read_timer.function = user_reader_timeout; |
| 544 | chip->user_read_timer.data = (unsigned long) chip; |
| 545 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 546 | chip->vendor = entry; |
| 547 | |
| 548 | chip->dev_num = -1; |
| 549 | |
Kylene Hall | 3122a88 | 2005-06-23 22:01:48 -0700 | [diff] [blame] | 550 | for (i = 0; i < TPM_NUM_MASK_ENTRIES; i++) |
| 551 | for (j = 0; j < 8 * sizeof(int); j++) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 552 | if ((dev_mask[i] & (1 << j)) == 0) { |
Kylene Hall | 3122a88 | 2005-06-23 22:01:48 -0700 | [diff] [blame] | 553 | chip->dev_num = |
| 554 | i * TPM_NUM_MASK_ENTRIES + j; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 555 | dev_mask[i] |= 1 << j; |
| 556 | goto dev_num_search_complete; |
| 557 | } |
| 558 | |
| 559 | dev_num_search_complete: |
| 560 | if (chip->dev_num < 0) { |
Andrew Morton | b888c87 | 2005-10-30 15:03:28 -0800 | [diff] [blame] | 561 | dev_err(dev, "No available tpm device numbers\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 562 | kfree(chip); |
| 563 | return -ENODEV; |
| 564 | } else if (chip->dev_num == 0) |
| 565 | chip->vendor->miscdev.minor = TPM_MINOR; |
| 566 | else |
| 567 | chip->vendor->miscdev.minor = MISC_DYNAMIC_MINOR; |
| 568 | |
Kylene Jo Hall | 6f9becc | 2005-06-25 14:55:41 -0700 | [diff] [blame] | 569 | devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL); |
| 570 | scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 571 | chip->vendor->miscdev.name = devname; |
| 572 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 573 | chip->vendor->miscdev.dev = dev; |
| 574 | chip->dev = get_device(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 575 | |
| 576 | if (misc_register(&chip->vendor->miscdev)) { |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 577 | dev_err(chip->dev, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 578 | "unable to misc_register %s, minor %d\n", |
| 579 | chip->vendor->miscdev.name, |
| 580 | chip->vendor->miscdev.minor); |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 581 | put_device(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 582 | kfree(chip); |
| 583 | dev_mask[i] &= !(1 << j); |
| 584 | return -ENODEV; |
| 585 | } |
| 586 | |
Kylene Hall | 5e976d5 | 2005-06-23 22:02:03 -0700 | [diff] [blame] | 587 | spin_lock(&driver_lock); |
| 588 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 589 | dev_set_drvdata(dev, chip); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 590 | |
| 591 | list_add(&chip->list, &tpm_chip_list); |
| 592 | |
Kylene Hall | 5e976d5 | 2005-06-23 22:02:03 -0700 | [diff] [blame] | 593 | spin_unlock(&driver_lock); |
| 594 | |
Kylene Jo Hall | e659a3f | 2005-10-30 15:03:24 -0800 | [diff] [blame] | 595 | sysfs_create_group(&dev->kobj, chip->vendor->attr_group); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 596 | |
Kylene Jo Hall | 55a82ab | 2006-01-08 01:03:15 -0800 | [diff] [blame] | 597 | chip->bios_dir = tpm_bios_log_setup(devname); |
| 598 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 599 | return 0; |
| 600 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 601 | EXPORT_SYMBOL_GPL(tpm_register_hardware); |
| 602 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 603 | MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)"); |
| 604 | MODULE_DESCRIPTION("TPM Driver"); |
| 605 | MODULE_VERSION("2.0"); |
| 606 | MODULE_LICENSE("GPL"); |