Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
aacce706
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
aacce706
编写于
3月 31, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ips: switch to ->show_info()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
56b8e8e5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
80 addition
and
161 deletion
+80
-161
drivers/scsi/ips.c
drivers/scsi/ips.c
+80
-152
drivers/scsi/ips.h
drivers/scsi/ips.h
+0
-9
未找到文件。
drivers/scsi/ips.c
浏览文件 @
aacce706
...
...
@@ -326,10 +326,9 @@ static void ips_scmd_buf_write(struct scsi_cmnd * scmd, void *data,
static
void
ips_scmd_buf_read
(
struct
scsi_cmnd
*
scmd
,
void
*
data
,
unsigned
int
count
);
static
int
ips_proc_info
(
struct
Scsi_Host
*
,
char
*
,
char
**
,
off_t
,
int
,
int
);
static
int
ips_host_info
(
ips_ha_t
*
,
char
*
,
off_t
,
int
);
static
void
copy_mem_info
(
IPS_INFOSTR
*
,
char
*
,
int
);
static
int
copy_info
(
IPS_INFOSTR
*
,
char
*
,
...);
static
int
ips_write_info
(
struct
Scsi_Host
*
,
char
*
,
int
);
static
int
ips_show_info
(
struct
seq_file
*
,
struct
Scsi_Host
*
);
static
int
ips_host_info
(
ips_ha_t
*
,
struct
seq_file
*
);
static
int
ips_abort_init
(
ips_ha_t
*
ha
,
int
index
);
static
int
ips_init_phase2
(
int
index
);
...
...
@@ -367,7 +366,8 @@ static struct scsi_host_template ips_driver_template = {
.
eh_abort_handler
=
ips_eh_abort
,
.
eh_host_reset_handler
=
ips_eh_reset
,
.
proc_name
=
"ips"
,
.
proc_info
=
ips_proc_info
,
.
show_info
=
ips_show_info
,
.
write_info
=
ips_write_info
,
.
slave_configure
=
ips_slave_configure
,
.
bios_param
=
ips_biosparam
,
.
this_id
=
-
1
,
...
...
@@ -1433,25 +1433,12 @@ ips_info(struct Scsi_Host *SH)
return
(
bp
);
}
/****************************************************************************/
/* */
/* Routine Name: ips_proc_info */
/* */
/* Routine Description: */
/* */
/* The passthru interface for the driver */
/* */
/****************************************************************************/
static
int
ips_proc_info
(
struct
Scsi_Host
*
host
,
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
,
int
func
)
ips_write_info
(
struct
Scsi_Host
*
host
,
char
*
buffer
,
int
length
)
{
int
i
;
int
ret
;
ips_ha_t
*
ha
=
NULL
;
METHOD_TRACE
(
"ips_proc_info"
,
1
);
/* Find our host structure */
for
(
i
=
0
;
i
<
ips_next_controller
;
i
++
)
{
if
(
ips_sh
[
i
])
{
...
...
@@ -1465,18 +1452,29 @@ ips_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
if
(
!
ha
)
return
(
-
EINVAL
);
if
(
func
)
{
/* write */
return
(
0
);
}
else
{
/* read */
if
(
start
)
*
start
=
buffer
;
return
0
;
}
ret
=
ips_host_info
(
ha
,
buffer
,
offset
,
length
);
static
int
ips_show_info
(
struct
seq_file
*
m
,
struct
Scsi_Host
*
host
)
{
int
i
;
ips_ha_t
*
ha
=
NULL
;
return
(
ret
);
/* Find our host structure */
for
(
i
=
0
;
i
<
ips_next_controller
;
i
++
)
{
if
(
ips_sh
[
i
])
{
if
(
ips_sh
[
i
]
==
host
)
{
ha
=
(
ips_ha_t
*
)
ips_sh
[
i
]
->
hostdata
;
break
;
}
}
}
if
(
!
ha
)
return
(
-
EINVAL
);
return
ips_host_info
(
ha
,
m
);
}
/*--------------------------------------------------------------------------*/
...
...
@@ -2035,183 +2033,113 @@ ips_cleanup_passthru(ips_ha_t * ha, ips_scb_t * scb)
/* */
/****************************************************************************/
static
int
ips_host_info
(
ips_ha_t
*
ha
,
char
*
ptr
,
off_t
offset
,
int
len
)
ips_host_info
(
ips_ha_t
*
ha
,
struct
seq_file
*
m
)
{
IPS_INFOSTR
info
;
METHOD_TRACE
(
"ips_host_info"
,
1
);
info
.
buffer
=
ptr
;
info
.
length
=
len
;
info
.
offset
=
offset
;
info
.
pos
=
0
;
info
.
localpos
=
0
;
copy_info
(
&
info
,
"
\n
IBM ServeRAID General Information:
\n\n
"
);
seq_printf
(
m
,
"
\n
IBM ServeRAID General Information:
\n\n
"
);
if
((
le32_to_cpu
(
ha
->
nvram
->
signature
)
==
IPS_NVRAM_P5_SIG
)
&&
(
le16_to_cpu
(
ha
->
nvram
->
adapter_type
)
!=
0
))
copy_info
(
&
info
,
"
\t
Controller Type : %s
\n
"
,
seq_printf
(
m
,
"
\t
Controller Type : %s
\n
"
,
ips_adapter_name
[
ha
->
ad_type
-
1
]);
else
copy_info
(
&
info
,
seq_printf
(
m
,
"
\t
Controller Type : Unknown
\n
"
);
if
(
ha
->
io_addr
)
copy_info
(
&
info
,
seq_printf
(
m
,
"
\t
IO region : 0x%lx (%d bytes)
\n
"
,
ha
->
io_addr
,
ha
->
io_len
);
if
(
ha
->
mem_addr
)
{
copy_info
(
&
info
,
seq_printf
(
m
,
"
\t
Memory region : 0x%lx (%d bytes)
\n
"
,
ha
->
mem_addr
,
ha
->
mem_len
);
copy_info
(
&
info
,
seq_printf
(
m
,
"
\t
Shared memory address : 0x%lx
\n
"
,
ha
->
mem_ptr
);
}
copy_info
(
&
info
,
"
\t
IRQ number : %d
\n
"
,
ha
->
pcidev
->
irq
);
seq_printf
(
m
,
"
\t
IRQ number : %d
\n
"
,
ha
->
pcidev
->
irq
);
/* For the Next 3 lines Check for Binary 0 at the end and don't include it if it's there. */
/* That keeps everything happy for "text" operations on the proc file. */
if
(
le32_to_cpu
(
ha
->
nvram
->
signature
)
==
IPS_NVRAM_P5_SIG
)
{
if
(
ha
->
nvram
->
bios_low
[
3
]
==
0
)
{
copy_info
(
&
info
,
"
\t
BIOS Version : %c%c%c%c%c%c%c
\n
"
,
ha
->
nvram
->
bios_high
[
0
],
ha
->
nvram
->
bios_high
[
1
],
ha
->
nvram
->
bios_high
[
2
],
ha
->
nvram
->
bios_high
[
3
],
ha
->
nvram
->
bios_low
[
0
],
ha
->
nvram
->
bios_low
[
1
],
ha
->
nvram
->
bios_low
[
2
]);
seq_printf
(
m
,
"
\t
BIOS Version : %c%c%c%c%c%c%c
\n
"
,
ha
->
nvram
->
bios_high
[
0
],
ha
->
nvram
->
bios_high
[
1
],
ha
->
nvram
->
bios_high
[
2
],
ha
->
nvram
->
bios_high
[
3
],
ha
->
nvram
->
bios_low
[
0
],
ha
->
nvram
->
bios_low
[
1
],
ha
->
nvram
->
bios_low
[
2
]);
}
else
{
copy_info
(
&
info
,
"
\t
BIOS Version : %c%c%c%c%c%c%c%c
\n
"
,
ha
->
nvram
->
bios_high
[
0
],
ha
->
nvram
->
bios_high
[
1
],
ha
->
nvram
->
bios_high
[
2
],
ha
->
nvram
->
bios_high
[
3
],
ha
->
nvram
->
bios_low
[
0
],
ha
->
nvram
->
bios_low
[
1
],
ha
->
nvram
->
bios_low
[
2
],
ha
->
nvram
->
bios_low
[
3
]);
seq_printf
(
m
,
"
\t
BIOS Version : %c%c%c%c%c%c%c%c
\n
"
,
ha
->
nvram
->
bios_high
[
0
],
ha
->
nvram
->
bios_high
[
1
],
ha
->
nvram
->
bios_high
[
2
],
ha
->
nvram
->
bios_high
[
3
],
ha
->
nvram
->
bios_low
[
0
],
ha
->
nvram
->
bios_low
[
1
],
ha
->
nvram
->
bios_low
[
2
],
ha
->
nvram
->
bios_low
[
3
]);
}
}
if
(
ha
->
enq
->
CodeBlkVersion
[
7
]
==
0
)
{
copy_info
(
&
info
,
"
\t
Firmware Version : %c%c%c%c%c%c%c
\n
"
,
ha
->
enq
->
CodeBlkVersion
[
0
],
ha
->
enq
->
CodeBlkVersion
[
1
],
ha
->
enq
->
CodeBlkVersion
[
2
],
ha
->
enq
->
CodeBlkVersion
[
3
],
ha
->
enq
->
CodeBlkVersion
[
4
],
ha
->
enq
->
CodeBlkVersion
[
5
],
ha
->
enq
->
CodeBlkVersion
[
6
]);
seq_printf
(
m
,
"
\t
Firmware Version : %c%c%c%c%c%c%c
\n
"
,
ha
->
enq
->
CodeBlkVersion
[
0
],
ha
->
enq
->
CodeBlkVersion
[
1
],
ha
->
enq
->
CodeBlkVersion
[
2
],
ha
->
enq
->
CodeBlkVersion
[
3
],
ha
->
enq
->
CodeBlkVersion
[
4
],
ha
->
enq
->
CodeBlkVersion
[
5
],
ha
->
enq
->
CodeBlkVersion
[
6
]);
}
else
{
copy_info
(
&
info
,
"
\t
Firmware Version : %c%c%c%c%c%c%c%c
\n
"
,
ha
->
enq
->
CodeBlkVersion
[
0
],
ha
->
enq
->
CodeBlkVersion
[
1
],
ha
->
enq
->
CodeBlkVersion
[
2
],
ha
->
enq
->
CodeBlkVersion
[
3
],
ha
->
enq
->
CodeBlkVersion
[
4
],
ha
->
enq
->
CodeBlkVersion
[
5
],
ha
->
enq
->
CodeBlkVersion
[
6
],
ha
->
enq
->
CodeBlkVersion
[
7
]);
seq_printf
(
m
,
"
\t
Firmware Version : %c%c%c%c%c%c%c%c
\n
"
,
ha
->
enq
->
CodeBlkVersion
[
0
],
ha
->
enq
->
CodeBlkVersion
[
1
],
ha
->
enq
->
CodeBlkVersion
[
2
],
ha
->
enq
->
CodeBlkVersion
[
3
],
ha
->
enq
->
CodeBlkVersion
[
4
],
ha
->
enq
->
CodeBlkVersion
[
5
],
ha
->
enq
->
CodeBlkVersion
[
6
],
ha
->
enq
->
CodeBlkVersion
[
7
]);
}
if
(
ha
->
enq
->
BootBlkVersion
[
7
]
==
0
)
{
copy_info
(
&
info
,
"
\t
Boot Block Version : %c%c%c%c%c%c%c
\n
"
,
ha
->
enq
->
BootBlkVersion
[
0
],
ha
->
enq
->
BootBlkVersion
[
1
],
ha
->
enq
->
BootBlkVersion
[
2
],
ha
->
enq
->
BootBlkVersion
[
3
],
ha
->
enq
->
BootBlkVersion
[
4
],
ha
->
enq
->
BootBlkVersion
[
5
],
ha
->
enq
->
BootBlkVersion
[
6
]);
seq_printf
(
m
,
"
\t
Boot Block Version : %c%c%c%c%c%c%c
\n
"
,
ha
->
enq
->
BootBlkVersion
[
0
],
ha
->
enq
->
BootBlkVersion
[
1
],
ha
->
enq
->
BootBlkVersion
[
2
],
ha
->
enq
->
BootBlkVersion
[
3
],
ha
->
enq
->
BootBlkVersion
[
4
],
ha
->
enq
->
BootBlkVersion
[
5
],
ha
->
enq
->
BootBlkVersion
[
6
]);
}
else
{
copy_info
(
&
info
,
"
\t
Boot Block Version : %c%c%c%c%c%c%c%c
\n
"
,
ha
->
enq
->
BootBlkVersion
[
0
],
ha
->
enq
->
BootBlkVersion
[
1
],
ha
->
enq
->
BootBlkVersion
[
2
],
ha
->
enq
->
BootBlkVersion
[
3
],
ha
->
enq
->
BootBlkVersion
[
4
],
ha
->
enq
->
BootBlkVersion
[
5
],
ha
->
enq
->
BootBlkVersion
[
6
],
ha
->
enq
->
BootBlkVersion
[
7
]);
seq_printf
(
m
,
"
\t
Boot Block Version : %c%c%c%c%c%c%c%c
\n
"
,
ha
->
enq
->
BootBlkVersion
[
0
],
ha
->
enq
->
BootBlkVersion
[
1
],
ha
->
enq
->
BootBlkVersion
[
2
],
ha
->
enq
->
BootBlkVersion
[
3
],
ha
->
enq
->
BootBlkVersion
[
4
],
ha
->
enq
->
BootBlkVersion
[
5
],
ha
->
enq
->
BootBlkVersion
[
6
],
ha
->
enq
->
BootBlkVersion
[
7
]);
}
copy_info
(
&
info
,
"
\t
Driver Version : %s%s
\n
"
,
seq_printf
(
m
,
"
\t
Driver Version : %s%s
\n
"
,
IPS_VERSION_HIGH
,
IPS_VERSION_LOW
);
copy_info
(
&
info
,
"
\t
Driver Build : %d
\n
"
,
seq_printf
(
m
,
"
\t
Driver Build : %d
\n
"
,
IPS_BUILD_IDENT
);
copy_info
(
&
info
,
"
\t
Max Physical Devices : %d
\n
"
,
seq_printf
(
m
,
"
\t
Max Physical Devices : %d
\n
"
,
ha
->
enq
->
ucMaxPhysicalDevices
);
copy_info
(
&
info
,
"
\t
Max Active Commands : %d
\n
"
,
seq_printf
(
m
,
"
\t
Max Active Commands : %d
\n
"
,
ha
->
max_cmds
);
copy_info
(
&
info
,
"
\t
Current Queued Commands : %d
\n
"
,
seq_printf
(
m
,
"
\t
Current Queued Commands : %d
\n
"
,
ha
->
scb_waitlist
.
count
);
copy_info
(
&
info
,
"
\t
Current Active Commands : %d
\n
"
,
seq_printf
(
m
,
"
\t
Current Active Commands : %d
\n
"
,
ha
->
scb_activelist
.
count
-
ha
->
num_ioctl
);
copy_info
(
&
info
,
"
\t
Current Queued PT Commands : %d
\n
"
,
seq_printf
(
m
,
"
\t
Current Queued PT Commands : %d
\n
"
,
ha
->
copp_waitlist
.
count
);
copy_info
(
&
info
,
"
\t
Current Active PT Commands : %d
\n
"
,
seq_printf
(
m
,
"
\t
Current Active PT Commands : %d
\n
"
,
ha
->
num_ioctl
);
copy_info
(
&
info
,
"
\n
"
);
return
(
info
.
localpos
);
}
/****************************************************************************/
/* */
/* Routine Name: copy_mem_info */
/* */
/* Routine Description: */
/* */
/* Copy data into an IPS_INFOSTR structure */
/* */
/****************************************************************************/
static
void
copy_mem_info
(
IPS_INFOSTR
*
info
,
char
*
data
,
int
len
)
{
METHOD_TRACE
(
"copy_mem_info"
,
1
);
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
);
info
->
pos
+=
(
info
->
offset
-
info
->
pos
);
}
if
(
info
->
localpos
+
len
>
info
->
length
)
len
=
info
->
length
-
info
->
localpos
;
seq_printf
(
m
,
"
\n
"
);
if
(
len
>
0
)
{
memcpy
(
info
->
buffer
+
info
->
localpos
,
data
,
len
);
info
->
pos
+=
len
;
info
->
localpos
+=
len
;
}
}
/****************************************************************************/
/* */
/* Routine Name: copy_info */
/* */
/* Routine Description: */
/* */
/* printf style wrapper for an info structure */
/* */
/****************************************************************************/
static
int
copy_info
(
IPS_INFOSTR
*
info
,
char
*
fmt
,
...)
{
va_list
args
;
char
buf
[
128
];
int
len
;
METHOD_TRACE
(
"copy_info"
,
1
);
va_start
(
args
,
fmt
);
len
=
vsprintf
(
buf
,
fmt
,
args
);
va_end
(
args
);
copy_mem_info
(
info
,
buf
,
len
);
return
(
len
);
return
0
;
}
/****************************************************************************/
...
...
drivers/scsi/ips.h
浏览文件 @
aacce706
...
...
@@ -416,7 +416,6 @@
/*
* Scsi_Host Template
*/
static
int
ips_proc_info
(
struct
Scsi_Host
*
,
char
*
,
char
**
,
off_t
,
int
,
int
);
static
int
ips_biosparam
(
struct
scsi_device
*
sdev
,
struct
block_device
*
bdev
,
sector_t
capacity
,
int
geom
[]);
static
int
ips_slave_configure
(
struct
scsi_device
*
SDptr
);
...
...
@@ -959,14 +958,6 @@ typedef union {
IPS_ENH_SG_LIST
*
enh_list
;
}
IPS_SG_LIST
;
typedef
struct
_IPS_INFOSTR
{
char
*
buffer
;
int
length
;
int
offset
;
int
pos
;
int
localpos
;
}
IPS_INFOSTR
;
typedef
struct
{
char
*
option_name
;
int
*
option_flag
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录