Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
11e29e21
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看板
提交
11e29e21
编写于
10月 21, 2005
作者:
A
Alan Cox
提交者:
Jeff Garzik
10月 21, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libata: handle early device PIO modes correctly
上级
307e4dc2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
8 deletion
+36
-8
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+27
-4
include/linux/ata.h
include/linux/ata.h
+9
-4
未找到文件。
drivers/scsi/libata-core.c
浏览文件 @
11e29e21
...
...
@@ -1082,6 +1082,31 @@ static inline void ata_dump_id(struct ata_device *dev)
dev
->
id
[
93
]);
}
/*
* Compute the PIO modes available for this device. This is not as
* trivial as it seems if we must consider early devices correctly.
*
* FIXME: pre IDE drive timing (do we care ?).
*/
static
unsigned
int
ata_pio_modes
(
struct
ata_device
*
adev
)
{
u16
modes
;
/* Usual case. Word 53 indicates word 88 is valid */
if
(
adev
->
id
[
ATA_ID_FIELD_VALID
]
&
(
1
<<
2
))
{
modes
=
adev
->
id
[
ATA_ID_PIO_MODES
]
&
0x03
;
modes
<<=
3
;
modes
|=
0x7
;
return
modes
;
}
/* If word 88 isn't valid then Word 51 holds the PIO timing number
for the maximum. Turn it into a mask and return it */
modes
=
(
2
<<
(
adev
->
id
[
ATA_ID_OLD_PIO_MODES
]
&
0xFF
))
-
1
;
return
modes
;
}
/**
* ata_dev_identify - obtain IDENTIFY x DEVICE page
* @ap: port on which device we wish to probe resides
...
...
@@ -1215,10 +1240,8 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
xfer_modes
=
dev
->
id
[
ATA_ID_UDMA_MODES
];
if
(
!
xfer_modes
)
xfer_modes
=
(
dev
->
id
[
ATA_ID_MWDMA_MODES
])
<<
ATA_SHIFT_MWDMA
;
if
(
!
xfer_modes
)
{
xfer_modes
=
(
dev
->
id
[
ATA_ID_PIO_MODES
])
<<
(
ATA_SHIFT_PIO
+
3
);
xfer_modes
|=
(
0x7
<<
ATA_SHIFT_PIO
);
}
if
(
!
xfer_modes
)
xfer_modes
=
ata_pio_modes
(
dev
);
ata_dump_id
(
dev
);
...
...
include/linux/ata.h
浏览文件 @
11e29e21
...
...
@@ -42,13 +42,18 @@ enum {
ATA_SECT_SIZE
=
512
,
ATA_ID_WORDS
=
256
,
ATA_ID_PROD_OFS
=
27
,
ATA_ID_FW_REV_OFS
=
23
,
ATA_ID_SERNO_OFS
=
10
,
ATA_ID_MAJOR_VER
=
80
,
ATA_ID_PIO_MODES
=
64
,
ATA_ID_FW_REV_OFS
=
23
,
ATA_ID_PROD_OFS
=
27
,
ATA_ID_OLD_PIO_MODES
=
51
,
ATA_ID_FIELD_VALID
=
53
,
ATA_ID_MWDMA_MODES
=
63
,
ATA_ID_PIO_MODES
=
64
,
ATA_ID_EIDE_DMA_MIN
=
65
,
ATA_ID_EIDE_PIO
=
67
,
ATA_ID_EIDE_PIO_IORDY
=
68
,
ATA_ID_UDMA_MODES
=
88
,
ATA_ID_MAJOR_VER
=
80
,
ATA_ID_PIO4
=
(
1
<<
1
),
ATA_PCI_CTL_OFS
=
2
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录