Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
972c26bd
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
972c26bd
编写于
19年前
作者:
J
Jeff Garzik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libata: add ata_sg_is_last() helper, use it in several drivers
上级
b194b425
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
16 deletion
+35
-16
drivers/scsi/pdc_adma.c
drivers/scsi/pdc_adma.c
+4
-4
drivers/scsi/sata_mv.c
drivers/scsi/sata_mv.c
+9
-7
drivers/scsi/sata_sil24.c
drivers/scsi/sata_sil24.c
+10
-5
include/linux/libata.h
include/linux/libata.h
+12
-0
未找到文件。
drivers/scsi/pdc_adma.c
浏览文件 @
972c26bd
...
...
@@ -293,14 +293,14 @@ static void adma_eng_timeout(struct ata_port *ap)
static
int
adma_fill_sg
(
struct
ata_queued_cmd
*
qc
)
{
struct
scatterlist
*
sg
=
qc
->
sg
;
struct
scatterlist
*
sg
;
struct
ata_port
*
ap
=
qc
->
ap
;
struct
adma_port_priv
*
pp
=
ap
->
private_data
;
u8
*
buf
=
pp
->
pkt
;
int
nelem
,
i
=
(
2
+
buf
[
3
])
*
8
;
int
i
=
(
2
+
buf
[
3
])
*
8
;
u8
pFLAGS
=
pORD
|
((
qc
->
tf
.
flags
&
ATA_TFLAG_WRITE
)
?
pDIRO
:
0
);
for
(
nelem
=
0
;
nelem
<
qc
->
n_elem
;
nelem
++
,
sg
++
)
{
ata_for_each_sg
(
sg
,
qc
)
{
u32
addr
;
u32
len
;
...
...
@@ -312,7 +312,7 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
*
(
__le32
*
)(
buf
+
i
)
=
cpu_to_le32
(
len
);
i
+=
4
;
if
(
(
nelem
+
1
)
==
qc
->
n_elem
)
if
(
ata_sg_is_last
(
sg
,
qc
)
)
pFLAGS
|=
pEND
;
buf
[
i
++
]
=
pFLAGS
;
buf
[
i
++
]
=
qc
->
dev
->
dma_mode
&
0xf
;
...
...
This diff is collapsed.
Click to expand it.
drivers/scsi/sata_mv.c
浏览文件 @
972c26bd
...
...
@@ -785,22 +785,24 @@ static void mv_port_stop(struct ata_port *ap)
static
void
mv_fill_sg
(
struct
ata_queued_cmd
*
qc
)
{
struct
mv_port_priv
*
pp
=
qc
->
ap
->
private_data
;
unsigned
int
i
;
unsigned
int
i
=
0
;
struct
scatterlist
*
sg
;
for
(
i
=
0
;
i
<
qc
->
n_elem
;
i
++
)
{
ata_for_each_sg
(
sg
,
qc
)
{
u32
sg_len
;
dma_addr_t
addr
;
addr
=
sg_dma_address
(
&
qc
->
sg
[
i
]
);
sg_len
=
sg_dma_len
(
&
qc
->
sg
[
i
]
);
addr
=
sg_dma_address
(
sg
);
sg_len
=
sg_dma_len
(
sg
);
pp
->
sg_tbl
[
i
].
addr
=
cpu_to_le32
(
addr
&
0xffffffff
);
pp
->
sg_tbl
[
i
].
addr_hi
=
cpu_to_le32
((
addr
>>
16
)
>>
16
);
assert
(
0
==
(
sg_len
&
~
MV_DMA_BOUNDARY
));
pp
->
sg_tbl
[
i
].
flags_size
=
cpu_to_le32
(
sg_len
);
}
if
(
0
<
qc
->
n_elem
)
{
pp
->
sg_tbl
[
qc
->
n_elem
-
1
].
flags_size
|=
EPRD_FLAG_END_OF_TBL
;
if
(
ata_sg_is_last
(
sg
,
qc
))
pp
->
sg_tbl
[
i
].
flags_size
|=
cpu_to_le32
(
EPRD_FLAG_END_OF_TBL
);
i
++
;
}
}
...
...
This diff is collapsed.
Click to expand it.
drivers/scsi/sata_sil24.c
浏览文件 @
972c26bd
...
...
@@ -416,15 +416,20 @@ static void sil24_phy_reset(struct ata_port *ap)
static
inline
void
sil24_fill_sg
(
struct
ata_queued_cmd
*
qc
,
struct
sil24_cmd_block
*
cb
)
{
struct
scatterlist
*
sg
=
qc
->
sg
;
struct
sil24_sge
*
sge
=
cb
->
sge
;
unsigned
i
;
struct
scatterlist
*
sg
;
unsigned
int
idx
=
0
;
for
(
i
=
0
;
i
<
qc
->
n_elem
;
i
++
,
sg
++
,
sge
++
)
{
ata_for_each_sg
(
sg
,
qc
)
{
sge
->
addr
=
cpu_to_le64
(
sg_dma_address
(
sg
));
sge
->
cnt
=
cpu_to_le32
(
sg_dma_len
(
sg
));
sge
->
flags
=
0
;
sge
->
flags
=
i
<
qc
->
n_elem
-
1
?
0
:
cpu_to_le32
(
SGE_TRM
);
if
(
ata_sg_is_last
(
sg
,
qc
))
sge
->
flags
=
cpu_to_le32
(
SGE_TRM
);
else
sge
->
flags
=
0
;
sge
++
;
idx
++
;
}
}
...
...
This diff is collapsed.
Click to expand it.
include/linux/libata.h
浏览文件 @
972c26bd
...
...
@@ -480,6 +480,18 @@ extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
#endif
/* CONFIG_PCI */
static
inline
int
ata_sg_is_last
(
struct
scatterlist
*
sg
,
struct
ata_queued_cmd
*
qc
)
{
if
(
sg
==
&
qc
->
pad_sgent
)
return
1
;
if
(
qc
->
pad_len
)
return
0
;
if
(((
sg
-
qc
->
__sg
)
+
1
)
==
qc
->
n_elem
)
return
1
;
return
0
;
}
static
inline
struct
scatterlist
*
ata_qc_next_sg
(
struct
scatterlist
*
sg
,
struct
ata_queued_cmd
*
qc
)
{
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部