Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a0441891
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看板
提交
a0441891
编写于
5月 09, 2007
作者:
J
Jens Axboe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qla1280: sg chaining support
Interesting hardware setup... Signed-off-by:
N
Jens Axboe
<
jens.axboe@oracle.com
>
上级
b0f655d0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
29 deletion
+37
-29
drivers/scsi/qla1280.c
drivers/scsi/qla1280.c
+37
-29
未找到文件。
drivers/scsi/qla1280.c
浏览文件 @
a0441891
...
...
@@ -2775,7 +2775,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
struct
device_reg
__iomem
*
reg
=
ha
->
iobase
;
struct
scsi_cmnd
*
cmd
=
sp
->
cmd
;
cmd_a64_entry_t
*
pkt
;
struct
scatterlist
*
sg
=
NULL
;
struct
scatterlist
*
sg
=
NULL
,
*
s
;
__le32
*
dword_ptr
;
dma_addr_t
dma_handle
;
int
status
=
0
;
...
...
@@ -2889,13 +2889,16 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
* Load data segments.
*/
if
(
seg_cnt
)
{
/* If data transfer. */
int
remseg
=
seg_cnt
;
/* Setup packet address segment pointer. */
dword_ptr
=
(
u32
*
)
&
pkt
->
dseg_0_address
;
if
(
cmd
->
use_sg
)
{
/* If scatter gather */
/* Load command entry data segments. */
for
(
cnt
=
0
;
cnt
<
2
&&
seg_cnt
;
cnt
++
,
seg_cnt
--
)
{
dma_handle
=
sg_dma_address
(
sg
);
for_each_sg
(
sg
,
s
,
seg_cnt
,
cnt
)
{
if
(
cnt
==
2
)
break
;
dma_handle
=
sg_dma_address
(
s
);
#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2)
if
(
ha
->
flags
.
use_pci_vchannel
)
sn_pci_set_vchan
(
ha
->
pdev
,
...
...
@@ -2906,12 +2909,12 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
cpu_to_le32
(
pci_dma_lo32
(
dma_handle
));
*
dword_ptr
++
=
cpu_to_le32
(
pci_dma_hi32
(
dma_handle
));
*
dword_ptr
++
=
cpu_to_le32
(
sg_dma_len
(
sg
));
sg
++
;
*
dword_ptr
++
=
cpu_to_le32
(
sg_dma_len
(
s
));
dprintk
(
3
,
"S/G Segment phys_addr=%x %x, len=0x%x
\n
"
,
cpu_to_le32
(
pci_dma_hi32
(
dma_handle
)),
cpu_to_le32
(
pci_dma_lo32
(
dma_handle
)),
cpu_to_le32
(
sg_dma_len
(
sg
)));
cpu_to_le32
(
sg_dma_len
(
sg_next
(
s
))));
remseg
--
;
}
dprintk
(
5
,
"qla1280_64bit_start_scsi: Scatter/gather "
"command packet data - b %i, t %i, l %i
\n
"
,
...
...
@@ -2926,7 +2929,9 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
dprintk
(
3
,
"S/G Building Continuation...seg_cnt=0x%x "
"remains
\n
"
,
seg_cnt
);
while
(
seg_cnt
>
0
)
{
while
(
remseg
>
0
)
{
/* Update sg start */
sg
=
s
;
/* Adjust ring index. */
ha
->
req_ring_index
++
;
if
(
ha
->
req_ring_index
==
REQUEST_ENTRY_CNT
)
{
...
...
@@ -2952,9 +2957,10 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
(
u32
*
)
&
((
struct
cont_a64_entry
*
)
pkt
)
->
dseg_0_address
;
/* Load continuation entry data segments. */
for
(
cnt
=
0
;
cnt
<
5
&&
seg_cnt
;
cnt
++
,
seg_cnt
--
)
{
dma_handle
=
sg_dma_address
(
sg
);
for_each_sg
(
sg
,
s
,
remseg
,
cnt
)
{
if
(
cnt
==
5
)
break
;
dma_handle
=
sg_dma_address
(
s
);
#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2)
if
(
ha
->
flags
.
use_pci_vchannel
)
sn_pci_set_vchan
(
ha
->
pdev
,
...
...
@@ -2966,12 +2972,12 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
*
dword_ptr
++
=
cpu_to_le32
(
pci_dma_hi32
(
dma_handle
));
*
dword_ptr
++
=
cpu_to_le32
(
sg_dma_len
(
s
g
));
cpu_to_le32
(
sg_dma_len
(
s
));
dprintk
(
3
,
"S/G Segment Cont. phys_addr=%x %x, len=0x%x
\n
"
,
cpu_to_le32
(
pci_dma_hi32
(
dma_handle
)),
cpu_to_le32
(
pci_dma_lo32
(
dma_handle
)),
cpu_to_le32
(
sg_dma_len
(
s
g
)));
sg
++
;
cpu_to_le32
(
sg_dma_len
(
s
)));
remseg
--
;
}
dprintk
(
5
,
"qla1280_64bit_start_scsi: "
"continuation packet data - b %i, t "
...
...
@@ -3062,7 +3068,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
struct
device_reg
__iomem
*
reg
=
ha
->
iobase
;
struct
scsi_cmnd
*
cmd
=
sp
->
cmd
;
struct
cmd_entry
*
pkt
;
struct
scatterlist
*
sg
=
NULL
;
struct
scatterlist
*
sg
=
NULL
,
*
s
;
__le32
*
dword_ptr
;
int
status
=
0
;
int
cnt
;
...
...
@@ -3188,6 +3194,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
* Load data segments.
*/
if
(
seg_cnt
)
{
int
remseg
=
seg_cnt
;
/* Setup packet address segment pointer. */
dword_ptr
=
&
pkt
->
dseg_0_address
;
...
...
@@ -3196,22 +3203,25 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
qla1280_dump_buffer
(
1
,
(
char
*
)
sg
,
4
*
16
);
/* Load command entry data segments. */
for
(
cnt
=
0
;
cnt
<
4
&&
seg_cnt
;
cnt
++
,
seg_cnt
--
)
{
for_each_sg
(
sg
,
s
,
seg_cnt
,
cnt
)
{
if
(
cnt
==
4
)
break
;
*
dword_ptr
++
=
cpu_to_le32
(
pci_dma_lo32
(
sg_dma_address
(
sg
)));
*
dword_ptr
++
=
cpu_to_le32
(
sg_dma_len
(
sg
));
cpu_to_le32
(
pci_dma_lo32
(
sg_dma_address
(
s
)));
*
dword_ptr
++
=
cpu_to_le32
(
sg_dma_len
(
s
));
dprintk
(
3
,
"S/G Segment phys_addr=0x%lx, len=0x%x
\n
"
,
(
pci_dma_lo32
(
sg_dma_address
(
s
g
))),
(
sg_dma_len
(
s
g
)));
sg
++
;
(
pci_dma_lo32
(
sg_dma_address
(
s
))),
(
sg_dma_len
(
s
)));
remseg
--
;
}
/*
* Build continuation packets.
*/
dprintk
(
3
,
"S/G Building Continuation"
"...seg_cnt=0x%x remains
\n
"
,
seg_cnt
);
while
(
seg_cnt
>
0
)
{
while
(
remseg
>
0
)
{
/* Continue from end point */
sg
=
s
;
/* Adjust ring index. */
ha
->
req_ring_index
++
;
if
(
ha
->
req_ring_index
==
REQUEST_ENTRY_CNT
)
{
...
...
@@ -3239,18 +3249,16 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
&
((
struct
cont_entry
*
)
pkt
)
->
dseg_0_address
;
/* Load continuation entry data segments. */
for
(
cnt
=
0
;
cnt
<
7
&&
seg_cnt
;
cnt
++
,
seg_cnt
--
)
{
for_each_sg
(
sg
,
s
,
remseg
,
cnt
)
{
*
dword_ptr
++
=
cpu_to_le32
(
pci_dma_lo32
(
sg_dma_address
(
s
g
)));
cpu_to_le32
(
pci_dma_lo32
(
sg_dma_address
(
s
)));
*
dword_ptr
++
=
cpu_to_le32
(
sg_dma_len
(
s
g
));
cpu_to_le32
(
sg_dma_len
(
s
));
dprintk
(
1
,
"S/G Segment Cont. phys_addr=0x%x, "
"len=0x%x
\n
"
,
cpu_to_le32
(
pci_dma_lo32
(
sg_dma_address
(
sg
))),
cpu_to_le32
(
sg_dma_len
(
sg
)));
sg
++
;
cpu_to_le32
(
pci_dma_lo32
(
sg_dma_address
(
s
))),
cpu_to_le32
(
sg_dma_len
(
s
)));
}
dprintk
(
5
,
"qla1280_32bit_start_scsi: "
"continuation packet data - "
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录