Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ff98f7ce
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ff98f7ce
编写于
3月 31, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dpt_i2o: switch to ->show_info()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
8c986544
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
90 deletion
+12
-90
drivers/scsi/dpt_i2o.c
drivers/scsi/dpt_i2o.c
+12
-90
未找到文件。
drivers/scsi/dpt_i2o.c
浏览文件 @
ff98f7ce
...
...
@@ -553,36 +553,14 @@ static const char *adpt_info(struct Scsi_Host *host)
return
(
char
*
)
(
pHba
->
detail
);
}
static
int
adpt_proc_info
(
struct
Scsi_Host
*
host
,
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
,
int
inout
)
static
int
adpt_show_info
(
struct
seq_file
*
m
,
struct
Scsi_Host
*
host
)
{
struct
adpt_device
*
d
;
int
id
;
int
chan
;
int
len
=
0
;
int
begin
=
0
;
int
pos
=
0
;
adpt_hba
*
pHba
;
int
unit
;
*
start
=
buffer
;
if
(
inout
==
TRUE
)
{
/*
* The user has done a write and wants us to take the
* data in the buffer and do something with it.
* proc_scsiwrite calls us with inout = 1
*
* Read data from buffer (writing to us) - NOT SUPPORTED
*/
return
-
EINVAL
;
}
/*
* inout = 0 means the user has done a read and wants information
* returned, so we write information about the cards into the buffer
* proc_scsiread() calls us with inout = 0
*/
// Find HBA (host bus adapter) we are looking for
mutex_lock
(
&
adpt_configuration_lock
);
for
(
pHba
=
hba_chain
;
pHba
;
pHba
=
pHba
->
next
)
{
...
...
@@ -596,86 +574,30 @@ static int adpt_proc_info(struct Scsi_Host *host, char *buffer, char **start, of
}
host
=
pHba
->
host
;
len
=
sprintf
(
buffer
,
"Adaptec I2O RAID Driver Version: %s
\n\n
"
,
DPT_I2O_VERSION
);
len
+=
sprintf
(
buffer
+
len
,
"%s
\n
"
,
pHba
->
detail
);
len
+=
sprintf
(
buffer
+
len
,
"SCSI Host=scsi%d Control Node=/dev/%s irq=%d
\n
"
,
seq_printf
(
m
,
"Adaptec I2O RAID Driver Version: %s
\n\n
"
,
DPT_I2O_VERSION
);
seq_printf
(
m
,
"%s
\n
"
,
pHba
->
detail
);
seq_printf
(
m
,
"SCSI Host=scsi%d Control Node=/dev/%s irq=%d
\n
"
,
pHba
->
host
->
host_no
,
pHba
->
name
,
host
->
irq
);
len
+=
sprintf
(
buffer
+
len
,
"
\t
post fifo size = %d
\n\t
reply fifo size = %d
\n\t
sg table size = %d
\n\n
"
,
seq_printf
(
m
,
"
\t
post fifo size = %d
\n\t
reply fifo size = %d
\n\t
sg table size = %d
\n\n
"
,
host
->
can_queue
,
(
int
)
pHba
->
reply_fifo_size
,
host
->
sg_tablesize
);
pos
=
begin
+
len
;
/* CHECKPOINT */
if
(
pos
>
offset
+
length
)
{
goto
stop_output
;
}
if
(
pos
<=
offset
)
{
/*
* If we haven't even written to where we last left
* off (the last time we were called), reset the
* beginning pointer.
*/
len
=
0
;
begin
=
pos
;
}
len
+=
sprintf
(
buffer
+
len
,
"Devices:
\n
"
);
seq_printf
(
m
,
"Devices:
\n
"
);
for
(
chan
=
0
;
chan
<
MAX_CHANNEL
;
chan
++
)
{
for
(
id
=
0
;
id
<
MAX_ID
;
id
++
)
{
d
=
pHba
->
channel
[
chan
].
device
[
id
];
while
(
d
){
len
+=
sprintf
(
buffer
+
len
,
"
\t
%-24.24s"
,
d
->
pScsi_dev
->
vendor
);
len
+=
sprintf
(
buffer
+
len
,
" Rev: %-8.8s
\n
"
,
d
->
pScsi_dev
->
rev
);
pos
=
begin
+
len
;
/* CHECKPOINT */
if
(
pos
>
offset
+
length
)
{
goto
stop_output
;
}
if
(
pos
<=
offset
)
{
len
=
0
;
begin
=
pos
;
}
while
(
d
)
{
seq_printf
(
m
,
"
\t
%-24.24s"
,
d
->
pScsi_dev
->
vendor
);
seq_printf
(
m
,
" Rev: %-8.8s
\n
"
,
d
->
pScsi_dev
->
rev
);
unit
=
d
->
pI2o_dev
->
lct_data
.
tid
;
len
+=
sprintf
(
buffer
+
len
,
"
\t
TID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)
\n\n
"
,
seq_printf
(
m
,
"
\t
TID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)
\n\n
"
,
unit
,
(
int
)
d
->
scsi_channel
,
(
int
)
d
->
scsi_id
,
(
int
)
d
->
scsi_lun
,
scsi_device_online
(
d
->
pScsi_dev
)
?
"online"
:
"offline"
);
pos
=
begin
+
len
;
/* CHECKPOINT */
if
(
pos
>
offset
+
length
)
{
goto
stop_output
;
}
if
(
pos
<=
offset
)
{
len
=
0
;
begin
=
pos
;
}
d
=
d
->
next_lun
;
}
}
}
/*
* begin is where we last checked our position with regards to offset
* begin is always less than offset. len is relative to begin. It
* is the number of bytes written past begin
*
*/
stop_output:
/* stop the output and calculate the correct length */
*
(
buffer
+
len
)
=
'\0'
;
*
start
=
buffer
+
(
offset
-
begin
);
/* Start of wanted data */
len
-=
(
offset
-
begin
);
if
(
len
>
length
)
{
len
=
length
;
}
else
if
(
len
<
0
){
len
=
0
;
**
start
=
'\0'
;
}
return
len
;
return
0
;
}
/*
...
...
@@ -3639,7 +3561,7 @@ static struct scsi_host_template driver_template = {
.
module
=
THIS_MODULE
,
.
name
=
"dpt_i2o"
,
.
proc_name
=
"dpt_i2o"
,
.
proc_info
=
adpt_proc
_info
,
.
show_info
=
adpt_show
_info
,
.
info
=
adpt_info
,
.
queuecommand
=
adpt_queue
,
.
eh_abort_handler
=
adpt_abort
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录