Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
25daa96f
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看板
提交
25daa96f
编写于
3月 31, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
BusLogic: switch to ->show_info()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
c8ed555a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
46 deletion
+38
-46
drivers/scsi/BusLogic.c
drivers/scsi/BusLogic.c
+38
-45
drivers/scsi/BusLogic.h
drivers/scsi/BusLogic.h
+0
-1
未找到文件。
drivers/scsi/BusLogic.c
浏览文件 @
25daa96f
...
...
@@ -3201,26 +3201,30 @@ static int BusLogic_BIOSDiskParameters(struct scsi_device *sdev, struct block_de
BugLogic_ProcDirectoryInfo implements /proc/scsi/BusLogic/<N>.
*/
static
int
BusLogic_
ProcDirectoryInfo
(
struct
Scsi_Host
*
shost
,
char
*
ProcBuffer
,
char
**
StartPointer
,
off_t
Offset
,
int
BytesAvailable
,
int
WriteFlag
)
static
int
BusLogic_
write_info
(
struct
Scsi_Host
*
shost
,
char
*
ProcBuffer
,
int
BytesAvailable
)
{
struct
BusLogic_HostAdapter
*
HostAdapter
=
(
struct
BusLogic_HostAdapter
*
)
shost
->
hostdata
;
struct
BusLogic_TargetStatistics
*
TargetStatistics
;
int
TargetID
,
Length
;
char
*
Buffer
;
TargetStatistics
=
HostAdapter
->
TargetStatistics
;
if
(
WriteFlag
)
{
HostAdapter
->
ExternalHostAdapterResets
=
0
;
HostAdapter
->
HostAdapterInternalErrors
=
0
;
memset
(
TargetStatistics
,
0
,
BusLogic_MaxTargetDevices
*
sizeof
(
struct
BusLogic_TargetStatistics
));
return
0
;
}
Buffer
=
HostAdapter
->
MessageBuffer
;
Length
=
HostAdapter
->
MessageBufferLength
;
Length
+=
sprintf
(
&
Buffer
[
Length
],
"
\n
\
HostAdapter
->
ExternalHostAdapterResets
=
0
;
HostAdapter
->
HostAdapterInternalErrors
=
0
;
memset
(
TargetStatistics
,
0
,
BusLogic_MaxTargetDevices
*
sizeof
(
struct
BusLogic_TargetStatistics
));
return
0
;
}
static
int
BusLogic_show_info
(
struct
seq_file
*
m
,
struct
Scsi_Host
*
shost
)
{
struct
BusLogic_HostAdapter
*
HostAdapter
=
(
struct
BusLogic_HostAdapter
*
)
shost
->
hostdata
;
struct
BusLogic_TargetStatistics
*
TargetStatistics
;
int
TargetID
;
TargetStatistics
=
HostAdapter
->
TargetStatistics
;
seq_write
(
m
,
HostAdapter
->
MessageBuffer
,
HostAdapter
->
MessageBufferLength
);
seq_printf
(
m
,
"
\n
\
Current Driver Queue Depth: %d
\n
\
Currently Allocated CCBs: %d
\n
"
,
HostAdapter
->
DriverQueueDepth
,
HostAdapter
->
AllocatedCCBs
);
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
"
\n\n
\
seq_printf
(
m
,
"
\n\n
\
DATA TRANSFER STATISTICS
\n
\
\n
\
Target Tagged Queuing Queue Depth Active Attempted Completed
\n
\
...
...
@@ -3229,66 +3233,62 @@ Target Tagged Queuing Queue Depth Active Attempted Completed\n\
struct
BusLogic_TargetFlags
*
TargetFlags
=
&
HostAdapter
->
TargetFlags
[
TargetID
];
if
(
!
TargetFlags
->
TargetExists
)
continue
;
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
" %2d %s"
,
TargetID
,
(
TargetFlags
->
TaggedQueuingSupported
?
(
TargetFlags
->
TaggedQueuingActive
?
" Active"
:
(
HostAdapter
->
TaggedQueuingPermitted
&
(
1
<<
TargetID
)
seq_printf
(
m
,
" %2d %s"
,
TargetID
,
(
TargetFlags
->
TaggedQueuingSupported
?
(
TargetFlags
->
TaggedQueuingActive
?
" Active"
:
(
HostAdapter
->
TaggedQueuingPermitted
&
(
1
<<
TargetID
)
?
" Permitted"
:
" Disabled"
))
:
"Not Supported"
));
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
seq_printf
(
m
,
" %3d %3u %9u %9u
\n
"
,
HostAdapter
->
QueueDepth
[
TargetID
],
HostAdapter
->
ActiveCommands
[
TargetID
],
TargetStatistics
[
TargetID
].
CommandsAttempted
,
TargetStatistics
[
TargetID
].
CommandsCompleted
);
}
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
"
\n
\
seq_printf
(
m
,
"
\n
\
Target Read Commands Write Commands Total Bytes Read Total Bytes Written
\n
\
====== ============= ============== =================== ===================
\n
"
);
for
(
TargetID
=
0
;
TargetID
<
HostAdapter
->
MaxTargetDevices
;
TargetID
++
)
{
struct
BusLogic_TargetFlags
*
TargetFlags
=
&
HostAdapter
->
TargetFlags
[
TargetID
];
if
(
!
TargetFlags
->
TargetExists
)
continue
;
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
" %2d %9u %9u"
,
TargetID
,
TargetStatistics
[
TargetID
].
ReadCommands
,
TargetStatistics
[
TargetID
].
WriteCommands
);
seq_printf
(
m
,
" %2d %9u %9u"
,
TargetID
,
TargetStatistics
[
TargetID
].
ReadCommands
,
TargetStatistics
[
TargetID
].
WriteCommands
);
if
(
TargetStatistics
[
TargetID
].
TotalBytesRead
.
Billions
>
0
)
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
" %9u%09u"
,
TargetStatistics
[
TargetID
].
TotalBytesRead
.
Billions
,
TargetStatistics
[
TargetID
].
TotalBytesRead
.
Units
);
seq_printf
(
m
,
" %9u%09u"
,
TargetStatistics
[
TargetID
].
TotalBytesRead
.
Billions
,
TargetStatistics
[
TargetID
].
TotalBytesRead
.
Units
);
else
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
" %9u"
,
TargetStatistics
[
TargetID
].
TotalBytesRead
.
Units
);
seq_printf
(
m
,
" %9u"
,
TargetStatistics
[
TargetID
].
TotalBytesRead
.
Units
);
if
(
TargetStatistics
[
TargetID
].
TotalBytesWritten
.
Billions
>
0
)
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
" %9u%09u
\n
"
,
TargetStatistics
[
TargetID
].
TotalBytesWritten
.
Billions
,
TargetStatistics
[
TargetID
].
TotalBytesWritten
.
Units
);
seq_printf
(
m
,
" %9u%09u
\n
"
,
TargetStatistics
[
TargetID
].
TotalBytesWritten
.
Billions
,
TargetStatistics
[
TargetID
].
TotalBytesWritten
.
Units
);
else
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
" %9u
\n
"
,
TargetStatistics
[
TargetID
].
TotalBytesWritten
.
Units
);
seq_printf
(
m
,
" %9u
\n
"
,
TargetStatistics
[
TargetID
].
TotalBytesWritten
.
Units
);
}
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
"
\n
\
seq_printf
(
m
,
"
\n
\
Target Command 0-1KB 1-2KB 2-4KB 4-8KB 8-16KB
\n
\
====== ======= ========= ========= ========= ========= =========
\n
"
);
for
(
TargetID
=
0
;
TargetID
<
HostAdapter
->
MaxTargetDevices
;
TargetID
++
)
{
struct
BusLogic_TargetFlags
*
TargetFlags
=
&
HostAdapter
->
TargetFlags
[
TargetID
];
if
(
!
TargetFlags
->
TargetExists
)
continue
;
Length
+=
sprintf
(
&
Buffer
[
Length
],
seq_printf
(
m
,
" %2d Read %9u %9u %9u %9u %9u
\n
"
,
TargetID
,
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
0
],
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
1
],
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
2
],
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
3
],
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
4
]);
Length
+=
sprintf
(
&
Buffer
[
Length
],
seq_printf
(
m
,
" %2d Write %9u %9u %9u %9u %9u
\n
"
,
TargetID
,
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
0
],
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
1
],
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
2
],
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
3
],
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
4
]);
}
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
"
\n
\
seq_printf
(
m
,
"
\n
\
Target Command 16-32KB 32-64KB 64-128KB 128-256KB 256KB+
\n
\
====== ======= ========= ========= ========= ========= =========
\n
"
);
for
(
TargetID
=
0
;
TargetID
<
HostAdapter
->
MaxTargetDevices
;
TargetID
++
)
{
struct
BusLogic_TargetFlags
*
TargetFlags
=
&
HostAdapter
->
TargetFlags
[
TargetID
];
if
(
!
TargetFlags
->
TargetExists
)
continue
;
Length
+=
sprintf
(
&
Buffer
[
Length
],
seq_printf
(
m
,
" %2d Read %9u %9u %9u %9u %9u
\n
"
,
TargetID
,
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
5
],
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
6
],
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
7
],
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
8
],
TargetStatistics
[
TargetID
].
ReadCommandSizeBuckets
[
9
]);
Length
+=
sprintf
(
&
Buffer
[
Length
],
seq_printf
(
m
,
" %2d Write %9u %9u %9u %9u %9u
\n
"
,
TargetID
,
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
5
],
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
6
],
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
7
],
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
8
],
TargetStatistics
[
TargetID
].
WriteCommandSizeBuckets
[
9
]);
}
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
"
\n\n
\
seq_printf
(
m
,
"
\n\n
\
ERROR RECOVERY STATISTICS
\n
\
\n
\
Command Aborts Bus Device Resets Host Adapter Resets
\n
\
...
...
@@ -3299,20 +3299,12 @@ Target Requested Completed Requested Completed Requested Completed\n\
struct
BusLogic_TargetFlags
*
TargetFlags
=
&
HostAdapter
->
TargetFlags
[
TargetID
];
if
(
!
TargetFlags
->
TargetExists
)
continue
;
Length
+=
sprintf
(
&
Buffer
[
Length
]
,
"\
seq_printf
(
m
,
"\
%2d %5d %5d %5d %5d %5d %5d %5d %5d %5d
\n
"
,
TargetID
,
TargetStatistics
[
TargetID
].
CommandAbortsRequested
,
TargetStatistics
[
TargetID
].
CommandAbortsAttempted
,
TargetStatistics
[
TargetID
].
CommandAbortsCompleted
,
TargetStatistics
[
TargetID
].
BusDeviceResetsRequested
,
TargetStatistics
[
TargetID
].
BusDeviceResetsAttempted
,
TargetStatistics
[
TargetID
].
BusDeviceResetsCompleted
,
TargetStatistics
[
TargetID
].
HostAdapterResetsRequested
,
TargetStatistics
[
TargetID
].
HostAdapterResetsAttempted
,
TargetStatistics
[
TargetID
].
HostAdapterResetsCompleted
);
}
Length
+=
sprintf
(
&
Buffer
[
Length
],
"
\n
External Host Adapter Resets: %d
\n
"
,
HostAdapter
->
ExternalHostAdapterResets
);
Length
+=
sprintf
(
&
Buffer
[
Length
],
"Host Adapter Internal Errors: %d
\n
"
,
HostAdapter
->
HostAdapterInternalErrors
);
if
(
Length
>=
BusLogic_MessageBufferSize
)
BusLogic_Error
(
"Message Buffer length %d exceeds size %d
\n
"
,
HostAdapter
,
Length
,
BusLogic_MessageBufferSize
);
if
((
Length
-=
Offset
)
<=
0
)
return
0
;
if
(
Length
>=
BytesAvailable
)
Length
=
BytesAvailable
;
memcpy
(
ProcBuffer
,
HostAdapter
->
MessageBuffer
+
Offset
,
Length
);
*
StartPointer
=
ProcBuffer
;
return
Length
;
seq_printf
(
m
,
"
\n
External Host Adapter Resets: %d
\n
"
,
HostAdapter
->
ExternalHostAdapterResets
);
seq_printf
(
m
,
"Host Adapter Internal Errors: %d
\n
"
,
HostAdapter
->
HostAdapterInternalErrors
);
return
0
;
}
...
...
@@ -3566,7 +3558,8 @@ static int __init BusLogic_ParseDriverOptions(char *OptionsString)
static
struct
scsi_host_template
Bus_Logic_template
=
{
.
module
=
THIS_MODULE
,
.
proc_name
=
"BusLogic"
,
.
proc_info
=
BusLogic_ProcDirectoryInfo
,
.
write_info
=
BusLogic_write_info
,
.
show_info
=
BusLogic_show_info
,
.
name
=
"BusLogic"
,
.
info
=
BusLogic_DriverInfo
,
.
queuecommand
=
BusLogic_QueueCommand
,
...
...
drivers/scsi/BusLogic.h
浏览文件 @
25daa96f
...
...
@@ -1321,7 +1321,6 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T Co
static
const
char
*
BusLogic_DriverInfo
(
struct
Scsi_Host
*
);
static
int
BusLogic_QueueCommand
(
struct
Scsi_Host
*
h
,
struct
scsi_cmnd
*
);
static
int
BusLogic_BIOSDiskParameters
(
struct
scsi_device
*
,
struct
block_device
*
,
sector_t
,
int
*
);
static
int
BusLogic_ProcDirectoryInfo
(
struct
Scsi_Host
*
,
char
*
,
char
**
,
off_t
,
int
,
int
);
static
int
BusLogic_SlaveConfigure
(
struct
scsi_device
*
);
static
void
BusLogic_QueueCompletedCCB
(
struct
BusLogic_CCB
*
);
static
irqreturn_t
BusLogic_InterruptHandler
(
int
,
void
*
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录