Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
51cf2249
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
51cf2249
编写于
7月 16, 2007
作者:
J
Jens Axboe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
aha1542: convert to use the data buffer accessors
Signed-off-by:
N
Jens Axboe
<
jens.axboe@oracle.com
>
上级
d274a987
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
17 deletion
+15
-17
drivers/scsi/aha1542.c
drivers/scsi/aha1542.c
+15
-17
未找到文件。
drivers/scsi/aha1542.c
浏览文件 @
51cf2249
...
...
@@ -61,15 +61,15 @@ static void BAD_DMA(void *address, unsigned int length)
}
static
void
BAD_SG_DMA
(
Scsi_Cmnd
*
SCpnt
,
struct
scatterlist
*
sgp
nt
,
struct
scatterlist
*
sgp
,
int
nseg
,
int
badseg
)
{
printk
(
KERN_CRIT
"sgpnt[%d:%d] page %p/0x%llx length %u
\n
"
,
badseg
,
nseg
,
page_address
(
sgp
nt
[
badseg
].
page
)
+
sgpnt
[
badseg
].
offset
,
(
unsigned
long
long
)
SCSI_SG_PA
(
&
sgpnt
[
badseg
]
),
sgp
nt
[
badseg
].
length
);
page_address
(
sgp
->
page
)
+
sgp
->
offset
,
(
unsigned
long
long
)
SCSI_SG_PA
(
sgp
),
sgp
->
length
);
/*
* Not safe to continue.
...
...
@@ -691,7 +691,7 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
memcpy
(
ccb
[
mbo
].
cdb
,
cmd
,
ccb
[
mbo
].
cdblen
);
if
(
SCpnt
->
use_sg
)
{
struct
scatterlist
*
sg
pnt
;
struct
scatterlist
*
sg
;
struct
chain
*
cptr
;
#ifdef DEBUG
unsigned
char
*
ptr
;
...
...
@@ -699,23 +699,21 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
int
i
;
ccb
[
mbo
].
op
=
2
;
/* SCSI Initiator Command w/scatter-gather */
SCpnt
->
host_scribble
=
kmalloc
(
512
,
GFP_KERNEL
|
GFP_DMA
);
sgpnt
=
(
struct
scatterlist
*
)
SCpnt
->
request_buffer
;
cptr
=
(
struct
chain
*
)
SCpnt
->
host_scribble
;
if
(
cptr
==
NULL
)
{
/* free the claimed mailbox slot */
HOSTDATA
(
SCpnt
->
device
->
host
)
->
SCint
[
mbo
]
=
NULL
;
return
SCSI_MLQUEUE_HOST_BUSY
;
}
for
(
i
=
0
;
i
<
SCpnt
->
use_sg
;
i
++
)
{
if
(
sg
pnt
[
i
].
length
==
0
||
SCpnt
->
use_sg
>
16
||
(((
int
)
sg
pnt
[
i
].
offset
)
&
1
)
||
(
sgpnt
[
i
].
length
&
1
))
{
scsi_for_each_sg
(
SCpnt
,
sg
,
SCpnt
->
use_sg
,
i
)
{
if
(
sg
->
length
==
0
||
SCpnt
->
use_sg
>
16
||
(((
int
)
sg
->
offset
)
&
1
)
||
(
sg
->
length
&
1
))
{
unsigned
char
*
ptr
;
printk
(
KERN_CRIT
"Bad segment list supplied to aha1542.c (%d, %d)
\n
"
,
SCpnt
->
use_sg
,
i
);
for
(
i
=
0
;
i
<
SCpnt
->
use_sg
;
i
++
)
{
scsi_for_each_sg
(
SCpnt
,
sg
,
SCpnt
->
use_sg
,
i
)
{
printk
(
KERN_CRIT
"%d: %p %d
\n
"
,
i
,
(
page_address
(
sgpnt
[
i
].
page
)
+
sgpnt
[
i
].
offset
),
sgpnt
[
i
].
length
);
(
page_address
(
sg
->
page
)
+
sg
->
offset
),
sg
->
length
);
};
printk
(
KERN_CRIT
"cptr %x: "
,
(
unsigned
int
)
cptr
);
ptr
=
(
unsigned
char
*
)
&
cptr
[
i
];
...
...
@@ -723,10 +721,10 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
printk
(
"%02x "
,
ptr
[
i
]);
panic
(
"Foooooooood fight!"
);
};
any2scsi
(
cptr
[
i
].
dataptr
,
SCSI_SG_PA
(
&
sgpnt
[
i
]
));
if
(
SCSI_SG_PA
(
&
sgpnt
[
i
])
+
sgpnt
[
i
].
length
-
1
>
ISA_DMA_THRESHOLD
)
BAD_SG_DMA
(
SCpnt
,
sg
pnt
,
SCpnt
->
use_sg
,
i
);
any2scsi
(
cptr
[
i
].
datalen
,
sg
pnt
[
i
].
length
);
any2scsi
(
cptr
[
i
].
dataptr
,
SCSI_SG_PA
(
sg
));
if
(
SCSI_SG_PA
(
sg
)
+
sg
->
length
-
1
>
ISA_DMA_THRESHOLD
)
BAD_SG_DMA
(
SCpnt
,
sg
,
SCpnt
->
use_sg
,
i
);
any2scsi
(
cptr
[
i
].
datalen
,
sg
->
length
);
};
any2scsi
(
ccb
[
mbo
].
datalen
,
SCpnt
->
use_sg
*
sizeof
(
struct
chain
));
any2scsi
(
ccb
[
mbo
].
dataptr
,
SCSI_BUF_PA
(
cptr
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录