Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
4d08a363
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4d08a363
编写于
3月 10, 2015
作者:
J
James Morris
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-current' of
https://github.com/PeterHuewe/linux-tpmdd
into for-linus
上级
9eccca08
19913b6d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
22 addition
and
28 deletion
+22
-28
drivers/char/tpm/tpm-chip.c
drivers/char/tpm/tpm-chip.c
+14
-20
drivers/char/tpm/tpm_ibmvtpm.c
drivers/char/tpm/tpm_ibmvtpm.c
+5
-5
drivers/char/tpm/tpm_ibmvtpm.h
drivers/char/tpm/tpm_ibmvtpm.h
+3
-3
未找到文件。
drivers/char/tpm/tpm-chip.c
浏览文件 @
4d08a363
...
...
@@ -140,24 +140,24 @@ static int tpm_dev_add_device(struct tpm_chip *chip)
{
int
rc
;
rc
=
device_add
(
&
chip
->
dev
);
rc
=
cdev_add
(
&
chip
->
cdev
,
chip
->
dev
.
devt
,
1
);
if
(
rc
)
{
dev_err
(
&
chip
->
dev
,
"unable to
device_register
() %s, major %d, minor %d, err=%d
\n
"
,
"unable to
cdev_add
() %s, major %d, minor %d, err=%d
\n
"
,
chip
->
devname
,
MAJOR
(
chip
->
dev
.
devt
),
MINOR
(
chip
->
dev
.
devt
),
rc
);
device_unregister
(
&
chip
->
dev
);
return
rc
;
}
rc
=
cdev_add
(
&
chip
->
cdev
,
chip
->
dev
.
devt
,
1
);
rc
=
device_add
(
&
chip
->
dev
);
if
(
rc
)
{
dev_err
(
&
chip
->
dev
,
"unable to
cdev_add
() %s, major %d, minor %d, err=%d
\n
"
,
"unable to
device_register
() %s, major %d, minor %d, err=%d
\n
"
,
chip
->
devname
,
MAJOR
(
chip
->
dev
.
devt
),
MINOR
(
chip
->
dev
.
devt
),
rc
);
device_unregister
(
&
chip
->
dev
);
return
rc
;
}
...
...
@@ -174,27 +174,17 @@ static void tpm_dev_del_device(struct tpm_chip *chip)
* tpm_chip_register() - create a character device for the TPM chip
* @chip: TPM chip to use.
*
* Creates a character device for the TPM chip and adds sysfs
interfac
es for
* the device
, PPI and TCPA. As the last step this function adds the
* chip
to the list of TPM chips available for
use.
* Creates a character device for the TPM chip and adds sysfs
attribut
es for
* the device
. As the last step this function adds the chip to the list of TPM
* chip
s available for in-kernel
use.
*
* NOTE: This function should be only called after the chip initialization
* is complete.
*
* Called from tpm_<specific>.c probe function only for devices
* the driver has determined it should claim. Prior to calling
* this function the specific probe function has called pci_enable_device
* upon errant exit from this function specific probe function should call
* pci_disable_device
* This function should be only called after the chip initialization is
* complete.
*/
int
tpm_chip_register
(
struct
tpm_chip
*
chip
)
{
int
rc
;
rc
=
tpm_dev_add_device
(
chip
);
if
(
rc
)
return
rc
;
/* Populate sysfs for TPM1 devices. */
if
(
!
(
chip
->
flags
&
TPM_CHIP_FLAG_TPM2
))
{
rc
=
tpm_sysfs_add_device
(
chip
);
...
...
@@ -208,6 +198,10 @@ int tpm_chip_register(struct tpm_chip *chip)
chip
->
bios_dir
=
tpm_bios_log_setup
(
chip
->
devname
);
}
rc
=
tpm_dev_add_device
(
chip
);
if
(
rc
)
return
rc
;
/* Make the chip available. */
spin_lock
(
&
driver_lock
);
list_add_rcu
(
&
chip
->
list
,
&
tpm_chip_list
);
...
...
drivers/char/tpm/tpm_ibmvtpm.c
浏览文件 @
4d08a363
...
...
@@ -124,7 +124,7 @@ static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
{
struct
ibmvtpm_dev
*
ibmvtpm
;
struct
ibmvtpm_crq
crq
;
u64
*
word
=
(
u64
*
)
&
crq
;
__be64
*
word
=
(
__be64
*
)
&
crq
;
int
rc
;
ibmvtpm
=
(
struct
ibmvtpm_dev
*
)
TPM_VPRIV
(
chip
);
...
...
@@ -145,11 +145,11 @@ static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
memcpy
((
void
*
)
ibmvtpm
->
rtce_buf
,
(
void
*
)
buf
,
count
);
crq
.
valid
=
(
u8
)
IBMVTPM_VALID_CMD
;
crq
.
msg
=
(
u8
)
VTPM_TPM_COMMAND
;
crq
.
len
=
(
u16
)
count
;
crq
.
data
=
ibmvtpm
->
rtce_dma_handle
;
crq
.
len
=
cpu_to_be16
(
count
)
;
crq
.
data
=
cpu_to_be32
(
ibmvtpm
->
rtce_dma_handle
)
;
rc
=
ibmvtpm_send_crq
(
ibmvtpm
->
vdev
,
cpu_to_be64
(
word
[
0
]),
cpu_to_be64
(
word
[
1
]));
rc
=
ibmvtpm_send_crq
(
ibmvtpm
->
vdev
,
be64_to_cpu
(
word
[
0
]),
be64_to_cpu
(
word
[
1
]));
if
(
rc
!=
H_SUCCESS
)
{
dev_err
(
ibmvtpm
->
dev
,
"tpm_ibmvtpm_send failed rc=%d
\n
"
,
rc
);
rc
=
0
;
...
...
drivers/char/tpm/tpm_ibmvtpm.h
浏览文件 @
4d08a363
...
...
@@ -22,9 +22,9 @@
struct
ibmvtpm_crq
{
u8
valid
;
u8
msg
;
u
16
len
;
u
32
data
;
u
64
reserved
;
__be
16
len
;
__be
32
data
;
__be
64
reserved
;
}
__attribute__
((
packed
,
aligned
(
8
)));
struct
ibmvtpm_crq_queue
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录