Linux 4.19.133
[linux/fpc-iii.git] / drivers / char / tpm / tpm_ibmvtpm.c
blob569e93e1f06ccdc978d30ee6035aa850dc2f5e72
1 /*
2 * Copyright (C) 2012-2020 IBM Corporation
4 * Author: Ashley Lai <ashleydlai@gmail.com>
6 * Maintained by: <tpmdd-devel@lists.sourceforge.net>
8 * Device driver for TCG/TCPA TPM (trusted platform module).
9 * Specifications at www.trustedcomputinggroup.org
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation, version 2 of the
14 * License.
18 #include <linux/dma-mapping.h>
19 #include <linux/dmapool.h>
20 #include <linux/slab.h>
21 #include <asm/vio.h>
22 #include <asm/irq.h>
23 #include <linux/types.h>
24 #include <linux/list.h>
25 #include <linux/spinlock.h>
26 #include <linux/interrupt.h>
27 #include <linux/wait.h>
28 #include <asm/prom.h>
30 #include "tpm.h"
31 #include "tpm_ibmvtpm.h"
33 static const char tpm_ibmvtpm_driver_name[] = "tpm_ibmvtpm";
35 static const struct vio_device_id tpm_ibmvtpm_device_table[] = {
36 { "IBM,vtpm", "IBM,vtpm"},
37 { "", "" }
39 MODULE_DEVICE_TABLE(vio, tpm_ibmvtpm_device_table);
41 /**
43 * ibmvtpm_send_crq_word - Send a CRQ request
44 * @vdev: vio device struct
45 * @w1: pre-constructed first word of tpm crq (second word is reserved)
47 * Return:
48 * 0 - Success
49 * Non-zero - Failure
51 static int ibmvtpm_send_crq_word(struct vio_dev *vdev, u64 w1)
53 return plpar_hcall_norets(H_SEND_CRQ, vdev->unit_address, w1, 0);
56 /**
58 * ibmvtpm_send_crq - Send a CRQ request
60 * @vdev: vio device struct
61 * @valid: Valid field
62 * @msg: Type field
63 * @len: Length field
64 * @data: Data field
66 * The ibmvtpm crq is defined as follows:
68 * Byte | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
69 * -----------------------------------------------------------------------
70 * Word0 | Valid | Type | Length | Data
71 * -----------------------------------------------------------------------
72 * Word1 | Reserved
73 * -----------------------------------------------------------------------
75 * Which matches the following structure (on bigendian host):
77 * struct ibmvtpm_crq {
78 * u8 valid;
79 * u8 msg;
80 * __be16 len;
81 * __be32 data;
82 * __be64 reserved;
83 * } __attribute__((packed, aligned(8)));
85 * However, the value is passed in a register so just compute the numeric value
86 * to load into the register avoiding byteswap altogether. Endian only affects
87 * memory loads and stores - registers are internally represented the same.
89 * Return:
90 * 0 (H_SUCCESS) - Success
91 * Non-zero - Failure
93 static int ibmvtpm_send_crq(struct vio_dev *vdev,
94 u8 valid, u8 msg, u16 len, u32 data)
96 u64 w1 = ((u64)valid << 56) | ((u64)msg << 48) | ((u64)len << 32) |
97 (u64)data;
98 return ibmvtpm_send_crq_word(vdev, w1);
102 * tpm_ibmvtpm_recv - Receive data after send
104 * @chip: tpm chip struct
105 * @buf: buffer to read
106 * @count: size of buffer
108 * Return:
109 * Number of bytes read
111 static int tpm_ibmvtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
113 struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
114 u16 len;
115 int sig;
117 if (!ibmvtpm->rtce_buf) {
118 dev_err(ibmvtpm->dev, "ibmvtpm device is not ready\n");
119 return 0;
122 sig = wait_event_interruptible(ibmvtpm->wq, !ibmvtpm->tpm_processing_cmd);
123 if (sig)
124 return -EINTR;
126 len = ibmvtpm->res_len;
128 if (count < len) {
129 dev_err(ibmvtpm->dev,
130 "Invalid size in recv: count=%zd, crq_size=%d\n",
131 count, len);
132 return -EIO;
135 spin_lock(&ibmvtpm->rtce_lock);
136 memcpy((void *)buf, (void *)ibmvtpm->rtce_buf, len);
137 memset(ibmvtpm->rtce_buf, 0, len);
138 ibmvtpm->res_len = 0;
139 spin_unlock(&ibmvtpm->rtce_lock);
140 return len;
144 * ibmvtpm_crq_send_init - Send a CRQ initialize message
145 * @ibmvtpm: vtpm device struct
147 * Return:
148 * 0 on success.
149 * Non-zero on failure.
151 static int ibmvtpm_crq_send_init(struct ibmvtpm_dev *ibmvtpm)
153 int rc;
155 rc = ibmvtpm_send_crq_word(ibmvtpm->vdev, INIT_CRQ_CMD);
156 if (rc != H_SUCCESS)
157 dev_err(ibmvtpm->dev,
158 "%s failed rc=%d\n", __func__, rc);
160 return rc;
164 * tpm_ibmvtpm_resume - Resume from suspend
166 * @dev: device struct
168 * Return: Always 0.
170 static int tpm_ibmvtpm_resume(struct device *dev)
172 struct tpm_chip *chip = dev_get_drvdata(dev);
173 struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
174 int rc = 0;
176 do {
177 if (rc)
178 msleep(100);
179 rc = plpar_hcall_norets(H_ENABLE_CRQ,
180 ibmvtpm->vdev->unit_address);
181 } while (rc == H_IN_PROGRESS || rc == H_BUSY || H_IS_LONG_BUSY(rc));
183 if (rc) {
184 dev_err(dev, "Error enabling ibmvtpm rc=%d\n", rc);
185 return rc;
188 rc = vio_enable_interrupts(ibmvtpm->vdev);
189 if (rc) {
190 dev_err(dev, "Error vio_enable_interrupts rc=%d\n", rc);
191 return rc;
194 rc = ibmvtpm_crq_send_init(ibmvtpm);
195 if (rc)
196 dev_err(dev, "Error send_init rc=%d\n", rc);
198 return rc;
202 * tpm_ibmvtpm_send() - Send a TPM command
203 * @chip: tpm chip struct
204 * @buf: buffer contains data to send
205 * @count: size of buffer
207 * Return:
208 * 0 on success,
209 * -errno on error
211 static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
213 struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
214 bool retry = true;
215 int rc, sig;
217 if (!ibmvtpm->rtce_buf) {
218 dev_err(ibmvtpm->dev, "ibmvtpm device is not ready\n");
219 return 0;
222 if (count > ibmvtpm->rtce_size) {
223 dev_err(ibmvtpm->dev,
224 "Invalid size in send: count=%zd, rtce_size=%d\n",
225 count, ibmvtpm->rtce_size);
226 return -EIO;
229 if (ibmvtpm->tpm_processing_cmd) {
230 dev_info(ibmvtpm->dev,
231 "Need to wait for TPM to finish\n");
232 /* wait for previous command to finish */
233 sig = wait_event_interruptible(ibmvtpm->wq, !ibmvtpm->tpm_processing_cmd);
234 if (sig)
235 return -EINTR;
238 spin_lock(&ibmvtpm->rtce_lock);
239 ibmvtpm->res_len = 0;
240 memcpy((void *)ibmvtpm->rtce_buf, (void *)buf, count);
243 * set the processing flag before the Hcall, since we may get the
244 * result (interrupt) before even being able to check rc.
246 ibmvtpm->tpm_processing_cmd = true;
248 again:
249 rc = ibmvtpm_send_crq(ibmvtpm->vdev,
250 IBMVTPM_VALID_CMD, VTPM_TPM_COMMAND,
251 count, ibmvtpm->rtce_dma_handle);
252 if (rc != H_SUCCESS) {
254 * H_CLOSED can be returned after LPM resume. Call
255 * tpm_ibmvtpm_resume() to re-enable the CRQ then retry
256 * ibmvtpm_send_crq() once before failing.
258 if (rc == H_CLOSED && retry) {
259 tpm_ibmvtpm_resume(ibmvtpm->dev);
260 retry = false;
261 goto again;
263 dev_err(ibmvtpm->dev, "tpm_ibmvtpm_send failed rc=%d\n", rc);
264 ibmvtpm->tpm_processing_cmd = false;
267 spin_unlock(&ibmvtpm->rtce_lock);
268 return 0;
271 static void tpm_ibmvtpm_cancel(struct tpm_chip *chip)
273 return;
276 static u8 tpm_ibmvtpm_status(struct tpm_chip *chip)
278 return 0;
282 * ibmvtpm_crq_get_rtce_size - Send a CRQ request to get rtce size
284 * @ibmvtpm: vtpm device struct
286 * Return:
287 * 0 on success.
288 * Non-zero on failure.
290 static int ibmvtpm_crq_get_rtce_size(struct ibmvtpm_dev *ibmvtpm)
292 int rc;
294 rc = ibmvtpm_send_crq(ibmvtpm->vdev,
295 IBMVTPM_VALID_CMD, VTPM_GET_RTCE_BUFFER_SIZE, 0, 0);
296 if (rc != H_SUCCESS)
297 dev_err(ibmvtpm->dev,
298 "ibmvtpm_crq_get_rtce_size failed rc=%d\n", rc);
300 return rc;
304 * ibmvtpm_crq_get_version - Send a CRQ request to get vtpm version
305 * - Note that this is vtpm version and not tpm version
307 * @ibmvtpm: vtpm device struct
309 * Return:
310 * 0 on success.
311 * Non-zero on failure.
313 static int ibmvtpm_crq_get_version(struct ibmvtpm_dev *ibmvtpm)
315 int rc;
317 rc = ibmvtpm_send_crq(ibmvtpm->vdev,
318 IBMVTPM_VALID_CMD, VTPM_GET_VERSION, 0, 0);
319 if (rc != H_SUCCESS)
320 dev_err(ibmvtpm->dev,
321 "ibmvtpm_crq_get_version failed rc=%d\n", rc);
323 return rc;
327 * ibmvtpm_crq_send_init_complete - Send a CRQ initialize complete message
328 * @ibmvtpm: vtpm device struct
330 * Return:
331 * 0 on success.
332 * Non-zero on failure.
334 static int ibmvtpm_crq_send_init_complete(struct ibmvtpm_dev *ibmvtpm)
336 int rc;
338 rc = ibmvtpm_send_crq_word(ibmvtpm->vdev, INIT_CRQ_COMP_CMD);
339 if (rc != H_SUCCESS)
340 dev_err(ibmvtpm->dev,
341 "ibmvtpm_crq_send_init_complete failed rc=%d\n", rc);
343 return rc;
347 * tpm_ibmvtpm_remove - ibm vtpm remove entry point
348 * @vdev: vio device struct
350 * Return: Always 0.
352 static int tpm_ibmvtpm_remove(struct vio_dev *vdev)
354 struct tpm_chip *chip = dev_get_drvdata(&vdev->dev);
355 struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
356 int rc = 0;
358 tpm_chip_unregister(chip);
360 free_irq(vdev->irq, ibmvtpm);
362 do {
363 if (rc)
364 msleep(100);
365 rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
366 } while (rc == H_BUSY || H_IS_LONG_BUSY(rc));
368 dma_unmap_single(ibmvtpm->dev, ibmvtpm->crq_dma_handle,
369 CRQ_RES_BUF_SIZE, DMA_BIDIRECTIONAL);
370 free_page((unsigned long)ibmvtpm->crq_queue.crq_addr);
372 if (ibmvtpm->rtce_buf) {
373 dma_unmap_single(ibmvtpm->dev, ibmvtpm->rtce_dma_handle,
374 ibmvtpm->rtce_size, DMA_BIDIRECTIONAL);
375 kfree(ibmvtpm->rtce_buf);
378 kfree(ibmvtpm);
379 /* For tpm_ibmvtpm_get_desired_dma */
380 dev_set_drvdata(&vdev->dev, NULL);
382 return 0;
386 * tpm_ibmvtpm_get_desired_dma - Get DMA size needed by this driver
387 * @vdev: vio device struct
389 * Return:
390 * Number of bytes the driver needs to DMA map.
392 static unsigned long tpm_ibmvtpm_get_desired_dma(struct vio_dev *vdev)
394 struct tpm_chip *chip = dev_get_drvdata(&vdev->dev);
395 struct ibmvtpm_dev *ibmvtpm;
398 * ibmvtpm initializes at probe time, so the data we are
399 * asking for may not be set yet. Estimate that 4K required
400 * for TCE-mapped buffer in addition to CRQ.
402 if (chip)
403 ibmvtpm = dev_get_drvdata(&chip->dev);
404 else
405 return CRQ_RES_BUF_SIZE + PAGE_SIZE;
407 return CRQ_RES_BUF_SIZE + ibmvtpm->rtce_size;
411 * tpm_ibmvtpm_suspend - Suspend
412 * @dev: device struct
414 * Return: Always 0.
416 static int tpm_ibmvtpm_suspend(struct device *dev)
418 struct tpm_chip *chip = dev_get_drvdata(dev);
419 struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
420 int rc = 0;
422 rc = ibmvtpm_send_crq(ibmvtpm->vdev,
423 IBMVTPM_VALID_CMD, VTPM_PREPARE_TO_SUSPEND, 0, 0);
424 if (rc != H_SUCCESS)
425 dev_err(ibmvtpm->dev,
426 "tpm_ibmvtpm_suspend failed rc=%d\n", rc);
428 return rc;
432 * ibmvtpm_reset_crq - Reset CRQ
434 * @ibmvtpm: ibm vtpm struct
436 * Return:
437 * 0 on success.
438 * Non-zero on failure.
440 static int ibmvtpm_reset_crq(struct ibmvtpm_dev *ibmvtpm)
442 int rc = 0;
444 do {
445 if (rc)
446 msleep(100);
447 rc = plpar_hcall_norets(H_FREE_CRQ,
448 ibmvtpm->vdev->unit_address);
449 } while (rc == H_BUSY || H_IS_LONG_BUSY(rc));
451 memset(ibmvtpm->crq_queue.crq_addr, 0, CRQ_RES_BUF_SIZE);
452 ibmvtpm->crq_queue.index = 0;
454 return plpar_hcall_norets(H_REG_CRQ, ibmvtpm->vdev->unit_address,
455 ibmvtpm->crq_dma_handle, CRQ_RES_BUF_SIZE);
458 static bool tpm_ibmvtpm_req_canceled(struct tpm_chip *chip, u8 status)
460 return (status == 0);
463 static const struct tpm_class_ops tpm_ibmvtpm = {
464 .recv = tpm_ibmvtpm_recv,
465 .send = tpm_ibmvtpm_send,
466 .cancel = tpm_ibmvtpm_cancel,
467 .status = tpm_ibmvtpm_status,
468 .req_complete_mask = 0,
469 .req_complete_val = 0,
470 .req_canceled = tpm_ibmvtpm_req_canceled,
473 static const struct dev_pm_ops tpm_ibmvtpm_pm_ops = {
474 .suspend = tpm_ibmvtpm_suspend,
475 .resume = tpm_ibmvtpm_resume,
479 * ibmvtpm_crq_get_next - Get next responded crq
481 * @ibmvtpm: vtpm device struct
483 * Return: vtpm crq pointer or NULL.
485 static struct ibmvtpm_crq *ibmvtpm_crq_get_next(struct ibmvtpm_dev *ibmvtpm)
487 struct ibmvtpm_crq_queue *crq_q = &ibmvtpm->crq_queue;
488 struct ibmvtpm_crq *crq = &crq_q->crq_addr[crq_q->index];
490 if (crq->valid & VTPM_MSG_RES) {
491 if (++crq_q->index == crq_q->num_entry)
492 crq_q->index = 0;
493 smp_rmb();
494 } else
495 crq = NULL;
496 return crq;
500 * ibmvtpm_crq_process - Process responded crq
502 * @crq: crq to be processed
503 * @ibmvtpm: vtpm device struct
506 static void ibmvtpm_crq_process(struct ibmvtpm_crq *crq,
507 struct ibmvtpm_dev *ibmvtpm)
509 int rc = 0;
511 switch (crq->valid) {
512 case VALID_INIT_CRQ:
513 switch (crq->msg) {
514 case INIT_CRQ_RES:
515 dev_info(ibmvtpm->dev, "CRQ initialized\n");
516 rc = ibmvtpm_crq_send_init_complete(ibmvtpm);
517 if (rc)
518 dev_err(ibmvtpm->dev, "Unable to send CRQ init complete rc=%d\n", rc);
519 return;
520 case INIT_CRQ_COMP_RES:
521 dev_info(ibmvtpm->dev,
522 "CRQ initialization completed\n");
523 return;
524 default:
525 dev_err(ibmvtpm->dev, "Unknown crq message type: %d\n", crq->msg);
526 return;
528 case IBMVTPM_VALID_CMD:
529 switch (crq->msg) {
530 case VTPM_GET_RTCE_BUFFER_SIZE_RES:
531 if (be16_to_cpu(crq->len) <= 0) {
532 dev_err(ibmvtpm->dev, "Invalid rtce size\n");
533 return;
535 ibmvtpm->rtce_size = be16_to_cpu(crq->len);
536 ibmvtpm->rtce_buf = kmalloc(ibmvtpm->rtce_size,
537 GFP_ATOMIC);
538 if (!ibmvtpm->rtce_buf) {
539 dev_err(ibmvtpm->dev, "Failed to allocate memory for rtce buffer\n");
540 return;
543 ibmvtpm->rtce_dma_handle = dma_map_single(ibmvtpm->dev,
544 ibmvtpm->rtce_buf, ibmvtpm->rtce_size,
545 DMA_BIDIRECTIONAL);
547 if (dma_mapping_error(ibmvtpm->dev,
548 ibmvtpm->rtce_dma_handle)) {
549 kfree(ibmvtpm->rtce_buf);
550 ibmvtpm->rtce_buf = NULL;
551 dev_err(ibmvtpm->dev, "Failed to dma map rtce buffer\n");
554 return;
555 case VTPM_GET_VERSION_RES:
556 ibmvtpm->vtpm_version = be32_to_cpu(crq->data);
557 return;
558 case VTPM_TPM_COMMAND_RES:
559 /* len of the data in rtce buffer */
560 ibmvtpm->res_len = be16_to_cpu(crq->len);
561 ibmvtpm->tpm_processing_cmd = false;
562 wake_up_interruptible(&ibmvtpm->wq);
563 return;
564 default:
565 return;
568 return;
572 * ibmvtpm_interrupt - Interrupt handler
574 * @irq: irq number to handle
575 * @vtpm_instance: vtpm that received interrupt
577 * Returns:
578 * IRQ_HANDLED
580 static irqreturn_t ibmvtpm_interrupt(int irq, void *vtpm_instance)
582 struct ibmvtpm_dev *ibmvtpm = (struct ibmvtpm_dev *) vtpm_instance;
583 struct ibmvtpm_crq *crq;
585 /* while loop is needed for initial setup (get version and
586 * get rtce_size). There should be only one tpm request at any
587 * given time.
589 while ((crq = ibmvtpm_crq_get_next(ibmvtpm)) != NULL) {
590 ibmvtpm_crq_process(crq, ibmvtpm);
591 crq->valid = 0;
592 smp_wmb();
595 return IRQ_HANDLED;
599 * tpm_ibmvtpm_probe - ibm vtpm initialize entry point
601 * @vio_dev: vio device struct
602 * @id: vio device id struct
604 * Return:
605 * 0 on success.
606 * Non-zero on failure.
608 static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
609 const struct vio_device_id *id)
611 struct ibmvtpm_dev *ibmvtpm;
612 struct device *dev = &vio_dev->dev;
613 struct ibmvtpm_crq_queue *crq_q;
614 struct tpm_chip *chip;
615 int rc = -ENOMEM, rc1;
617 chip = tpmm_chip_alloc(dev, &tpm_ibmvtpm);
618 if (IS_ERR(chip))
619 return PTR_ERR(chip);
621 ibmvtpm = kzalloc(sizeof(struct ibmvtpm_dev), GFP_KERNEL);
622 if (!ibmvtpm) {
623 dev_err(dev, "kzalloc for ibmvtpm failed\n");
624 goto cleanup;
627 ibmvtpm->dev = dev;
628 ibmvtpm->vdev = vio_dev;
630 crq_q = &ibmvtpm->crq_queue;
631 crq_q->crq_addr = (struct ibmvtpm_crq *)get_zeroed_page(GFP_KERNEL);
632 if (!crq_q->crq_addr) {
633 dev_err(dev, "Unable to allocate memory for crq_addr\n");
634 goto cleanup;
637 crq_q->num_entry = CRQ_RES_BUF_SIZE / sizeof(*crq_q->crq_addr);
638 ibmvtpm->crq_dma_handle = dma_map_single(dev, crq_q->crq_addr,
639 CRQ_RES_BUF_SIZE,
640 DMA_BIDIRECTIONAL);
642 if (dma_mapping_error(dev, ibmvtpm->crq_dma_handle)) {
643 dev_err(dev, "dma mapping failed\n");
644 goto cleanup;
647 rc = plpar_hcall_norets(H_REG_CRQ, vio_dev->unit_address,
648 ibmvtpm->crq_dma_handle, CRQ_RES_BUF_SIZE);
649 if (rc == H_RESOURCE)
650 rc = ibmvtpm_reset_crq(ibmvtpm);
652 if (rc) {
653 dev_err(dev, "Unable to register CRQ rc=%d\n", rc);
654 goto reg_crq_cleanup;
657 rc = request_irq(vio_dev->irq, ibmvtpm_interrupt, 0,
658 tpm_ibmvtpm_driver_name, ibmvtpm);
659 if (rc) {
660 dev_err(dev, "Error %d register irq 0x%x\n", rc, vio_dev->irq);
661 goto init_irq_cleanup;
664 rc = vio_enable_interrupts(vio_dev);
665 if (rc) {
666 dev_err(dev, "Error %d enabling interrupts\n", rc);
667 goto init_irq_cleanup;
670 init_waitqueue_head(&ibmvtpm->wq);
672 crq_q->index = 0;
674 dev_set_drvdata(&chip->dev, ibmvtpm);
676 spin_lock_init(&ibmvtpm->rtce_lock);
678 rc = ibmvtpm_crq_send_init(ibmvtpm);
679 if (rc)
680 goto init_irq_cleanup;
682 rc = ibmvtpm_crq_get_version(ibmvtpm);
683 if (rc)
684 goto init_irq_cleanup;
686 rc = ibmvtpm_crq_get_rtce_size(ibmvtpm);
687 if (rc)
688 goto init_irq_cleanup;
690 return tpm_chip_register(chip);
691 init_irq_cleanup:
692 do {
693 rc1 = plpar_hcall_norets(H_FREE_CRQ, vio_dev->unit_address);
694 } while (rc1 == H_BUSY || H_IS_LONG_BUSY(rc1));
695 reg_crq_cleanup:
696 dma_unmap_single(dev, ibmvtpm->crq_dma_handle, CRQ_RES_BUF_SIZE,
697 DMA_BIDIRECTIONAL);
698 cleanup:
699 if (ibmvtpm) {
700 if (crq_q->crq_addr)
701 free_page((unsigned long)crq_q->crq_addr);
702 kfree(ibmvtpm);
705 return rc;
708 static struct vio_driver ibmvtpm_driver = {
709 .id_table = tpm_ibmvtpm_device_table,
710 .probe = tpm_ibmvtpm_probe,
711 .remove = tpm_ibmvtpm_remove,
712 .get_desired_dma = tpm_ibmvtpm_get_desired_dma,
713 .name = tpm_ibmvtpm_driver_name,
714 .pm = &tpm_ibmvtpm_pm_ops,
718 * ibmvtpm_module_init - Initialize ibm vtpm module.
721 * Return:
722 * 0 on success.
723 * Non-zero on failure.
725 static int __init ibmvtpm_module_init(void)
727 return vio_register_driver(&ibmvtpm_driver);
731 * ibmvtpm_module_exit - Tear down ibm vtpm module.
733 static void __exit ibmvtpm_module_exit(void)
735 vio_unregister_driver(&ibmvtpm_driver);
738 module_init(ibmvtpm_module_init);
739 module_exit(ibmvtpm_module_exit);
741 MODULE_AUTHOR("adlai@us.ibm.com");
742 MODULE_DESCRIPTION("IBM vTPM Driver");
743 MODULE_VERSION("1.0");
744 MODULE_LICENSE("GPL");