Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
ee127fec
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ee127fec
编写于
3月 31, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sym53c8xx_2: switch to ->show_info()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
0ffddfbb
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
21 addition
and
94 deletion
+21
-94
drivers/scsi/sym53c8xx_2/sym_glue.c
drivers/scsi/sym53c8xx_2/sym_glue.c
+21
-94
未找到文件。
drivers/scsi/sym53c8xx_2/sym_glue.c
浏览文件 @
ee127fec
...
...
@@ -1171,112 +1171,36 @@ printk("sym_user_command: data=%ld\n", uc->data);
#endif
/* SYM_LINUX_USER_COMMAND_SUPPORT */
#ifdef SYM_LINUX_USER_INFO_SUPPORT
/*
* Informations through the proc file system.
*/
struct
info_str
{
char
*
buffer
;
int
length
;
int
offset
;
int
pos
;
};
static
void
copy_mem_info
(
struct
info_str
*
info
,
char
*
data
,
int
len
)
{
if
(
info
->
pos
+
len
>
info
->
length
)
len
=
info
->
length
-
info
->
pos
;
if
(
info
->
pos
+
len
<
info
->
offset
)
{
info
->
pos
+=
len
;
return
;
}
if
(
info
->
pos
<
info
->
offset
)
{
data
+=
(
info
->
offset
-
info
->
pos
);
len
-=
(
info
->
offset
-
info
->
pos
);
}
if
(
len
>
0
)
{
memcpy
(
info
->
buffer
+
info
->
pos
,
data
,
len
);
info
->
pos
+=
len
;
}
}
static
int
copy_info
(
struct
info_str
*
info
,
char
*
fmt
,
...)
{
va_list
args
;
char
buf
[
81
];
int
len
;
va_start
(
args
,
fmt
);
len
=
vsprintf
(
buf
,
fmt
,
args
);
va_end
(
args
);
copy_mem_info
(
info
,
buf
,
len
);
return
len
;
}
/*
* Copy formatted information into the input buffer.
*/
static
int
sym_
host_info
(
struct
Scsi_Host
*
shost
,
char
*
ptr
,
off_t
offset
,
int
len
)
static
int
sym_
show_info
(
struct
seq_file
*
m
,
struct
Scsi_Host
*
shost
)
{
#ifdef SYM_LINUX_USER_INFO_SUPPORT
struct
sym_data
*
sym_data
=
shost_priv
(
shost
);
struct
pci_dev
*
pdev
=
sym_data
->
pdev
;
struct
sym_hcb
*
np
=
sym_data
->
ncb
;
struct
info_str
info
;
info
.
buffer
=
ptr
;
info
.
length
=
len
;
info
.
offset
=
offset
;
info
.
pos
=
0
;
copy_info
(
&
info
,
"Chip "
NAME53C
"%s, device id 0x%x, "
seq_printf
(
m
,
"Chip "
NAME53C
"%s, device id 0x%x, "
"revision id 0x%x
\n
"
,
np
->
s
.
chip_name
,
pdev
->
device
,
pdev
->
revision
);
copy_info
(
&
info
,
"At PCI address %s, IRQ %u
\n
"
,
seq_printf
(
m
,
"At PCI address %s, IRQ %u
\n
"
,
pci_name
(
pdev
),
pdev
->
irq
);
copy_info
(
&
info
,
"Min. period factor %d, %s SCSI BUS%s
\n
"
,
seq_printf
(
m
,
"Min. period factor %d, %s SCSI BUS%s
\n
"
,
(
int
)
(
np
->
minsync_dt
?
np
->
minsync_dt
:
np
->
minsync
),
np
->
maxwide
?
"Wide"
:
"Narrow"
,
np
->
minsync_dt
?
", DT capable"
:
""
);
copy_info
(
&
info
,
"Max. started commands %d, "
seq_printf
(
m
,
"Max. started commands %d, "
"max. commands per LUN %d
\n
"
,
SYM_CONF_MAX_START
,
SYM_CONF_MAX_TAG
);
return
info
.
pos
>
info
.
offset
?
info
.
pos
-
info
.
offset
:
0
;
}
#endif
/* SYM_LINUX_USER_INFO_SUPPORT */
/*
* Entry point of the scsi proc fs of the driver.
* - func = 0 means read (returns adapter infos)
* - func = 1 means write (not yet merget from sym53c8xx)
*/
static
int
sym53c8xx_proc_info
(
struct
Scsi_Host
*
shost
,
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
,
int
func
)
{
int
retv
;
if
(
func
)
{
#ifdef SYM_LINUX_USER_COMMAND_SUPPORT
retv
=
sym_user_command
(
shost
,
buffer
,
length
);
#else
retv
=
-
EINVAL
;
#endif
}
else
{
if
(
start
)
*
start
=
buffer
;
#ifdef SYM_LINUX_USER_INFO_SUPPORT
retv
=
sym_host_info
(
shost
,
buffer
,
offset
,
length
);
return
0
;
#else
retv
=
-
EINVAL
;
#endif
}
return
retv
;
return
-
EINVAL
;
#endif
/* SYM_LINUX_USER_INFO_SUPPORT */
}
#endif
/* SYM_LINUX_PROC_INFO_SUPPORT */
/*
...
...
@@ -1742,7 +1666,10 @@ static struct scsi_host_template sym2_template = {
.
use_clustering
=
ENABLE_CLUSTERING
,
.
max_sectors
=
0xFFFF
,
#ifdef SYM_LINUX_PROC_INFO_SUPPORT
.
proc_info
=
sym53c8xx_proc_info
,
.
show_info
=
sym_show_info
,
#ifdef SYM_LINUX_USER_COMMAND_SUPPORT
.
write_info
=
sym_user_command
,
#endif
.
proc_name
=
NAME53C8XX
,
#endif
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录