Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
887fc88e
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看板
提交
887fc88e
编写于
3月 31, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
in2000: switch to ->show_info()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
d773e422
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
72 addition
and
106 deletion
+72
-106
drivers/scsi/in2000.c
drivers/scsi/in2000.c
+72
-106
未找到文件。
drivers/scsi/in2000.c
浏览文件 @
887fc88e
...
...
@@ -2166,152 +2166,117 @@ static int in2000_biosparam(struct scsi_device *sdev, struct block_device *bdev,
}
static
int
in2000_
proc_info
(
struct
Scsi_Host
*
instance
,
char
*
buf
,
char
**
start
,
off_t
off
,
int
len
,
int
i
n
)
static
int
in2000_
write_info
(
struct
Scsi_Host
*
instance
,
char
*
buf
,
int
le
n
)
{
#ifdef PROC_INTERFACE
char
*
bp
;
char
tbuf
[
128
];
unsigned
long
flags
;
struct
IN2000_hostdata
*
hd
;
Scsi_Cmnd
*
cmd
;
int
x
,
i
;
static
int
stop
=
0
;
hd
=
(
struct
IN2000_hostdata
*
)
instance
->
hostdata
;
/* If 'in' is TRUE we need to _read_ the proc file. We accept the following
* keywords (same format as command-line, but only ONE per read):
* debug
* disconnect
* period
* resync
* proc
*/
if
(
in
)
{
buf
[
len
]
=
'\0'
;
bp
=
buf
;
if
(
!
strncmp
(
bp
,
"debug:"
,
6
))
{
bp
+=
6
;
hd
->
args
=
simple_strtoul
(
bp
,
NULL
,
0
)
&
DB_MASK
;
}
else
if
(
!
strncmp
(
bp
,
"disconnect:"
,
11
))
{
bp
+=
11
;
x
=
simple_strtoul
(
bp
,
NULL
,
0
);
if
(
x
<
DIS_NEVER
||
x
>
DIS_ALWAYS
)
x
=
DIS_ADAPTIVE
;
hd
->
disconnect
=
x
;
}
else
if
(
!
strncmp
(
bp
,
"period:"
,
7
))
{
bp
+=
7
;
x
=
simple_strtoul
(
bp
,
NULL
,
0
);
hd
->
default_sx_per
=
sx_table
[
round_period
((
unsigned
int
)
x
)].
period_ns
;
}
else
if
(
!
strncmp
(
bp
,
"resync:"
,
7
))
{
bp
+=
7
;
x
=
simple_strtoul
(
bp
,
NULL
,
0
);
for
(
i
=
0
;
i
<
7
;
i
++
)
if
(
x
&
(
1
<<
i
))
hd
->
sync_stat
[
i
]
=
SS_UNSET
;
}
else
if
(
!
strncmp
(
bp
,
"proc:"
,
5
))
{
bp
+=
5
;
hd
->
proc
=
simple_strtoul
(
bp
,
NULL
,
0
);
}
else
if
(
!
strncmp
(
bp
,
"level2:"
,
7
))
{
bp
+=
7
;
hd
->
level2
=
simple_strtoul
(
bp
,
NULL
,
0
);
}
return
len
;
buf
[
len
]
=
'\0'
;
bp
=
buf
;
if
(
!
strncmp
(
bp
,
"debug:"
,
6
))
{
bp
+=
6
;
hd
->
args
=
simple_strtoul
(
bp
,
NULL
,
0
)
&
DB_MASK
;
}
else
if
(
!
strncmp
(
bp
,
"disconnect:"
,
11
))
{
bp
+=
11
;
x
=
simple_strtoul
(
bp
,
NULL
,
0
);
if
(
x
<
DIS_NEVER
||
x
>
DIS_ALWAYS
)
x
=
DIS_ADAPTIVE
;
hd
->
disconnect
=
x
;
}
else
if
(
!
strncmp
(
bp
,
"period:"
,
7
))
{
bp
+=
7
;
x
=
simple_strtoul
(
bp
,
NULL
,
0
);
hd
->
default_sx_per
=
sx_table
[
round_period
((
unsigned
int
)
x
)].
period_ns
;
}
else
if
(
!
strncmp
(
bp
,
"resync:"
,
7
))
{
bp
+=
7
;
x
=
simple_strtoul
(
bp
,
NULL
,
0
);
for
(
i
=
0
;
i
<
7
;
i
++
)
if
(
x
&
(
1
<<
i
))
hd
->
sync_stat
[
i
]
=
SS_UNSET
;
}
else
if
(
!
strncmp
(
bp
,
"proc:"
,
5
))
{
bp
+=
5
;
hd
->
proc
=
simple_strtoul
(
bp
,
NULL
,
0
);
}
else
if
(
!
strncmp
(
bp
,
"level2:"
,
7
))
{
bp
+=
7
;
hd
->
level2
=
simple_strtoul
(
bp
,
NULL
,
0
);
}
#endif
return
len
;
}
static
int
in2000_show_info
(
struct
seq_file
*
m
,
struct
Scsi_Host
*
instance
)
{
#ifdef PROC_INTERFACE
unsigned
long
flags
;
struct
IN2000_hostdata
*
hd
;
Scsi_Cmnd
*
cmd
;
int
x
;
hd
=
(
struct
IN2000_hostdata
*
)
instance
->
hostdata
;
spin_lock_irqsave
(
instance
->
host_lock
,
flags
);
bp
=
buf
;
*
bp
=
'\0'
;
if
(
hd
->
proc
&
PR_VERSION
)
{
sprintf
(
tbuf
,
"
\n
Version %s - %s."
,
IN2000_VERSION
,
IN2000_DATE
);
strcat
(
bp
,
tbuf
);
}
if
(
hd
->
proc
&
PR_VERSION
)
seq_printf
(
m
,
"
\n
Version %s - %s."
,
IN2000_VERSION
,
IN2000_DATE
);
if
(
hd
->
proc
&
PR_INFO
)
{
sprintf
(
tbuf
,
"
\n
dip_switch=%02x: irq=%d io=%02x floppy=%s sync/DOS5=%s"
,
(
hd
->
dip_switch
&
0x7f
),
instance
->
irq
,
hd
->
io_base
,
(
hd
->
dip_switch
&
0x40
)
?
"Yes"
:
"No"
,
(
hd
->
dip_switch
&
0x20
)
?
"Yes"
:
"No"
);
strcat
(
bp
,
tbuf
);
strcat
(
bp
,
"
\n
sync_xfer[] = "
);
for
(
x
=
0
;
x
<
7
;
x
++
)
{
sprintf
(
tbuf
,
"
\t
%02x"
,
hd
->
sync_xfer
[
x
]);
strcat
(
bp
,
tbuf
);
}
strcat
(
bp
,
"
\n
sync_stat[] = "
);
for
(
x
=
0
;
x
<
7
;
x
++
)
{
sprintf
(
tbuf
,
"
\t
%02x"
,
hd
->
sync_stat
[
x
]);
strcat
(
bp
,
tbuf
);
}
seq_printf
(
m
,
"
\n
dip_switch=%02x: irq=%d io=%02x floppy=%s sync/DOS5=%s"
,
(
hd
->
dip_switch
&
0x7f
),
instance
->
irq
,
hd
->
io_base
,
(
hd
->
dip_switch
&
0x40
)
?
"Yes"
:
"No"
,
(
hd
->
dip_switch
&
0x20
)
?
"Yes"
:
"No"
);
seq_printf
(
m
,
"
\n
sync_xfer[] = "
);
for
(
x
=
0
;
x
<
7
;
x
++
)
seq_printf
(
m
,
"
\t
%02x"
,
hd
->
sync_xfer
[
x
]);
seq_printf
(
m
,
"
\n
sync_stat[] = "
);
for
(
x
=
0
;
x
<
7
;
x
++
)
seq_printf
(
m
,
"
\t
%02x"
,
hd
->
sync_stat
[
x
]);
}
#ifdef PROC_STATISTICS
if
(
hd
->
proc
&
PR_STATISTICS
)
{
strcat
(
bp
,
"
\n
commands issued: "
);
for
(
x
=
0
;
x
<
7
;
x
++
)
{
sprintf
(
tbuf
,
"
\t
%ld"
,
hd
->
cmd_cnt
[
x
]);
strcat
(
bp
,
tbuf
);
}
strcat
(
bp
,
"
\n
disconnects allowed:"
);
for
(
x
=
0
;
x
<
7
;
x
++
)
{
sprintf
(
tbuf
,
"
\t
%ld"
,
hd
->
disc_allowed_cnt
[
x
]);
strcat
(
bp
,
tbuf
);
}
strcat
(
bp
,
"
\n
disconnects done: "
);
for
(
x
=
0
;
x
<
7
;
x
++
)
{
sprintf
(
tbuf
,
"
\t
%ld"
,
hd
->
disc_done_cnt
[
x
]);
strcat
(
bp
,
tbuf
);
}
sprintf
(
tbuf
,
"
\n
interrupts:
\t
%ld"
,
hd
->
int_cnt
);
strcat
(
bp
,
tbuf
);
seq_printf
(
m
,
"
\n
commands issued: "
);
for
(
x
=
0
;
x
<
7
;
x
++
)
seq_printf
(
m
,
"
\t
%ld"
,
hd
->
cmd_cnt
[
x
]);
seq_printf
(
m
,
"
\n
disconnects allowed:"
);
for
(
x
=
0
;
x
<
7
;
x
++
)
seq_printf
(
m
,
"
\t
%ld"
,
hd
->
disc_allowed_cnt
[
x
]);
seq_printf
(
m
,
"
\n
disconnects done: "
);
for
(
x
=
0
;
x
<
7
;
x
++
)
seq_printf
(
m
,
"
\t
%ld"
,
hd
->
disc_done_cnt
[
x
]);
seq_printf
(
m
,
"
\n
interrupts:
\t
%ld"
,
hd
->
int_cnt
);
}
#endif
if
(
hd
->
proc
&
PR_CONNECTED
)
{
s
trcat
(
bp
,
"
\n
connected: "
);
s
eq_printf
(
m
,
"
\n
connected: "
);
if
(
hd
->
connected
)
{
cmd
=
(
Scsi_Cmnd
*
)
hd
->
connected
;
sprintf
(
tbuf
,
" %d:%d(%02x)"
,
cmd
->
device
->
id
,
cmd
->
device
->
lun
,
cmd
->
cmnd
[
0
]);
strcat
(
bp
,
tbuf
);
seq_printf
(
m
,
" %d:%d(%02x)"
,
cmd
->
device
->
id
,
cmd
->
device
->
lun
,
cmd
->
cmnd
[
0
]);
}
}
if
(
hd
->
proc
&
PR_INPUTQ
)
{
s
trcat
(
bp
,
"
\n
input_Q: "
);
s
eq_printf
(
m
,
"
\n
input_Q: "
);
cmd
=
(
Scsi_Cmnd
*
)
hd
->
input_Q
;
while
(
cmd
)
{
sprintf
(
tbuf
,
" %d:%d(%02x)"
,
cmd
->
device
->
id
,
cmd
->
device
->
lun
,
cmd
->
cmnd
[
0
]);
strcat
(
bp
,
tbuf
);
seq_printf
(
m
,
" %d:%d(%02x)"
,
cmd
->
device
->
id
,
cmd
->
device
->
lun
,
cmd
->
cmnd
[
0
]);
cmd
=
(
Scsi_Cmnd
*
)
cmd
->
host_scribble
;
}
}
if
(
hd
->
proc
&
PR_DISCQ
)
{
s
trcat
(
bp
,
"
\n
disconnected_Q:"
);
s
eq_printf
(
m
,
"
\n
disconnected_Q:"
);
cmd
=
(
Scsi_Cmnd
*
)
hd
->
disconnected_Q
;
while
(
cmd
)
{
sprintf
(
tbuf
,
" %d:%d(%02x)"
,
cmd
->
device
->
id
,
cmd
->
device
->
lun
,
cmd
->
cmnd
[
0
]);
strcat
(
bp
,
tbuf
);
seq_printf
(
m
,
" %d:%d(%02x)"
,
cmd
->
device
->
id
,
cmd
->
device
->
lun
,
cmd
->
cmnd
[
0
]);
cmd
=
(
Scsi_Cmnd
*
)
cmd
->
host_scribble
;
}
}
if
(
hd
->
proc
&
PR_TEST
)
{
;
/* insert your own custom function here */
}
s
trcat
(
bp
,
"
\n
"
);
s
eq_printf
(
m
,
"
\n
"
);
spin_unlock_irqrestore
(
instance
->
host_lock
,
flags
);
*
start
=
buf
;
if
(
stop
)
{
stop
=
0
;
return
0
;
/* return 0 to signal end-of-file */
}
if
(
off
>
0x40000
)
/* ALWAYS stop after 256k bytes have been read */
stop
=
1
;
if
(
hd
->
proc
&
PR_STOP
)
/* stop every other time */
stop
=
1
;
return
strlen
(
bp
);
#else
/* PROC_INTERFACE */
return
0
;
#endif
/* PROC_INTERFACE */
return
0
;
}
MODULE_LICENSE
(
"GPL"
);
...
...
@@ -2319,7 +2284,8 @@ MODULE_LICENSE("GPL");
static
struct
scsi_host_template
driver_template
=
{
.
proc_name
=
"in2000"
,
.
proc_info
=
in2000_proc_info
,
.
write_info
=
in2000_write_info
,
.
show_info
=
in2000_show_info
,
.
name
=
"Always IN2000"
,
.
detect
=
in2000_detect
,
.
release
=
in2000_release
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录