Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
c187c4b5
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看板
提交
c187c4b5
编写于
10月 04, 2005
作者:
A
Albert Lee
提交者:
Jeff Garzik
10月 04, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libata: minor whitespace, comment, debug message updates
上级
47a86593
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
8 deletion
+17
-8
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+17
-8
未找到文件。
drivers/scsi/libata-scsi.c
浏览文件 @
c187c4b5
...
...
@@ -589,7 +589,8 @@ static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
head
=
track
%
dev
->
heads
;
sect
=
(
u32
)
block
%
dev
->
sectors
+
1
;
DPRINTK
(
"block[%u] track[%u] cyl[%u] head[%u] sect[%u]
\n
"
,
(
u32
)
block
,
track
,
cyl
,
head
,
sect
);
DPRINTK
(
"block %u track %u cyl %u head %u sect %u
\n
"
,
(
u32
)
block
,
track
,
cyl
,
head
,
sect
);
/* Check whether the converted CHS can fit.
Cylinder: 0-65535
...
...
@@ -665,6 +666,10 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
block
|=
((
u64
)
scsicmd
[
3
]);
n_block
|=
((
u32
)
scsicmd
[
4
]);
/* for 6-byte r/w commands, transfer length 0
* means 256 blocks of data, not 0 block.
*/
if
(
!
n_block
)
n_block
=
256
;
...
...
@@ -692,7 +697,11 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
/* Check and compose ATA command */
if
(
!
n_block
)
/* In ATA, sector count 0 means 256 or 65536 sectors, not 0 sectors. */
/* For 10-byte and 16-byte SCSI R/W commands, transfer
* length 0 means transfer 0 block of data.
* However, for ATA R/W commands, sector count 0 means
* 256 or 65536 sectors, not 0 sectors as in SCSI.
*/
return
1
;
if
(
lba
)
{
...
...
@@ -715,7 +724,7 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
tf
->
device
|=
(
block
>>
24
)
&
0xf
;
}
qc
->
nsect
=
n_block
;
tf
->
nsect
=
n_block
&
0xff
;
...
...
@@ -731,23 +740,23 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
/* The request -may- be too large for CHS addressing. */
if
((
block
>>
28
)
||
(
n_block
>
256
))
return
1
;
/* Convert LBA to CHS */
track
=
(
u32
)
block
/
dev
->
sectors
;
cyl
=
track
/
dev
->
heads
;
head
=
track
%
dev
->
heads
;
sect
=
(
u32
)
block
%
dev
->
sectors
+
1
;
DPRINTK
(
"block
[%u] track[%u] cyl[%u] head[%u] sect[%u]
\n
"
,
DPRINTK
(
"block
%u track %u cyl %u head %u sect %u
\n
"
,
(
u32
)
block
,
track
,
cyl
,
head
,
sect
);
/* Check whether the converted CHS can fit.
Cylinder: 0-65535
Head: 0-15
Sector: 1-255*/
if
((
cyl
>>
16
)
||
(
head
>>
4
)
||
(
sect
>>
8
)
||
(
!
sect
))
if
((
cyl
>>
16
)
||
(
head
>>
4
)
||
(
sect
>>
8
)
||
(
!
sect
))
return
1
;
qc
->
nsect
=
n_block
;
tf
->
nsect
=
n_block
&
0xff
;
/* Sector count 0 means 256 sectors */
tf
->
lbal
=
sect
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录