ccp-dev.c (8c57a5e7b2820f349c95b8c8393fec1e0f4070d2) ccp-dev.c (956ee21a6df08afd9c1c64e0f394a9a1b65e897d)
1/*
2 * AMD Cryptographic Coprocessor (CCP) driver
3 *
4 * Copyright (C) 2013,2016 Advanced Micro Devices, Inc.
5 *
6 * Author: Tom Lendacky <thomas.lendacky@amd.com>
1/*
2 * AMD Cryptographic Coprocessor (CCP) driver
3 *
4 * Copyright (C) 2013,2016 Advanced Micro Devices, Inc.
5 *
6 * Author: Tom Lendacky <thomas.lendacky@amd.com>
7 * Author: Gary R Hook <gary.hook@amd.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/kthread.h>
16#include <linux/sched.h>
17#include <linux/interrupt.h>
18#include <linux/spinlock.h>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/kthread.h>
17#include <linux/sched.h>
18#include <linux/interrupt.h>
19#include <linux/spinlock.h>
19#include <linux/rwlock_types.h>
20#include <linux/spinlock_types.h>
20#include <linux/types.h>
21#include <linux/mutex.h>
22#include <linux/delay.h>
23#include <linux/hw_random.h>
24#include <linux/cpu.h>
25#ifdef CONFIG_X86
26#include <asm/cpu_device_id.h>
27#endif

--- 364 unchanged lines hidden (view full) ---

392 return NULL;
393 ccp->dev = dev;
394
395 INIT_LIST_HEAD(&ccp->cmd);
396 INIT_LIST_HEAD(&ccp->backlog);
397
398 spin_lock_init(&ccp->cmd_lock);
399 mutex_init(&ccp->req_mutex);
21#include <linux/types.h>
22#include <linux/mutex.h>
23#include <linux/delay.h>
24#include <linux/hw_random.h>
25#include <linux/cpu.h>
26#ifdef CONFIG_X86
27#include <asm/cpu_device_id.h>
28#endif

--- 364 unchanged lines hidden (view full) ---

393 return NULL;
394 ccp->dev = dev;
395
396 INIT_LIST_HEAD(&ccp->cmd);
397 INIT_LIST_HEAD(&ccp->backlog);
398
399 spin_lock_init(&ccp->cmd_lock);
400 mutex_init(&ccp->req_mutex);
400 mutex_init(&ccp->ksb_mutex);
401 ccp->ksb_count = KSB_COUNT;
402 ccp->ksb_start = 0;
401 mutex_init(&ccp->sb_mutex);
402 ccp->sb_count = KSB_COUNT;
403 ccp->sb_start = 0;
403
404 ccp->ord = ccp_increment_unit_ordinal();
405 snprintf(ccp->name, MAX_CCP_NAME_LEN, "ccp-%u", ccp->ord);
406 snprintf(ccp->rngname, MAX_CCP_NAME_LEN, "ccp-%u-rng", ccp->ord);
407
408 return ccp;
409}
410

--- 69 unchanged lines hidden ---
404
405 ccp->ord = ccp_increment_unit_ordinal();
406 snprintf(ccp->name, MAX_CCP_NAME_LEN, "ccp-%u", ccp->ord);
407 snprintf(ccp->rngname, MAX_CCP_NAME_LEN, "ccp-%u-rng", ccp->ord);
408
409 return ccp;
410}
411

--- 69 unchanged lines hidden ---