Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
5c68429d
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5c68429d
编写于
2月 01, 2008
作者:
B
Bartlomiej Zolnierkiewicz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ide-cd: merge cdrom_select_speed() into ide_cdrom_select_speed()
Signed-off-by:
N
Bartlomiej Zolnierkiewicz
<
bzolnier@gmail.com
>
上级
53126b91
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
29 addition
and
37 deletion
+29
-37
drivers/ide/ide-cd.c
drivers/ide/ide-cd.c
+29
-37
未找到文件。
drivers/ide/ide-cd.c
浏览文件 @
5c68429d
...
...
@@ -2017,38 +2017,6 @@ static int ide_cd_read_tochdr(ide_drive_t *drive, void *arg)
return
0
;
}
/* ATAPI cdrom drives are free to select the speed you request or any slower
rate :-( Requesting too fast a speed will _not_ produce an error. */
static
int
cdrom_select_speed
(
ide_drive_t
*
drive
,
int
speed
,
struct
request_sense
*
sense
)
{
struct
cdrom_info
*
cd
=
drive
->
driver_data
;
struct
cdrom_device_info
*
cdi
=
&
cd
->
devinfo
;
struct
request
req
;
cdrom_prepare_request
(
drive
,
&
req
);
req
.
sense
=
sense
;
if
(
speed
==
0
)
speed
=
0xffff
;
/* set to max */
else
speed
*=
177
;
/* Nx to kbytes/s */
req
.
cmd
[
0
]
=
GPCMD_SET_SPEED
;
/* Read Drive speed in kbytes/second MSB */
req
.
cmd
[
2
]
=
(
speed
>>
8
)
&
0xff
;
/* Read Drive speed in kbytes/second LSB */
req
.
cmd
[
3
]
=
speed
&
0xff
;
if
((
cdi
->
mask
&
(
CDC_CD_R
|
CDC_CD_RW
|
CDC_DVD_R
))
!=
(
CDC_CD_R
|
CDC_CD_RW
|
CDC_DVD_R
))
{
/* Write Drive speed in kbytes/second MSB */
req
.
cmd
[
4
]
=
(
speed
>>
8
)
&
0xff
;
/* Write Drive speed in kbytes/second LSB */
req
.
cmd
[
5
]
=
speed
&
0xff
;
}
return
cdrom_queue_packet_command
(
drive
,
&
req
);
}
static
int
cdrom_get_toc_entry
(
ide_drive_t
*
drive
,
int
track
,
struct
atapi_toc_entry
**
ent
)
{
...
...
@@ -2272,22 +2240,46 @@ static void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf)
cd
->
max_speed
=
(
maxspeed
+
(
176
/
2
))
/
176
;
}
static
int
ide_cdrom_select_speed
(
struct
cdrom_device_info
*
cdi
,
int
speed
)
/*
* ATAPI devices are free to select the speed you request or any slower
* rate. :-( Requesting too fast a speed will _not_ produce an error.
*/
static
int
ide_cdrom_select_speed
(
struct
cdrom_device_info
*
cdi
,
int
speed
)
{
ide_drive_t
*
drive
=
cdi
->
handle
;
struct
cdrom_info
*
cd
=
drive
->
driver_data
;
struct
request
rq
;
struct
request_sense
sense
;
u8
buf
[
ATAPI_CAPABILITIES_PAGE_SIZE
];
int
stat
;
if
((
stat
=
cdrom_select_speed
(
drive
,
speed
,
&
sense
))
<
0
)
return
stat
;
cdrom_prepare_request
(
drive
,
&
rq
);
rq
.
sense
=
&
sense
;
if
(
speed
==
0
)
speed
=
0xffff
;
/* set to max */
else
speed
*=
177
;
/* Nx to kbytes/s */
rq
.
cmd
[
0
]
=
GPCMD_SET_SPEED
;
/* Read Drive speed in kbytes/second MSB/LSB */
rq
.
cmd
[
2
]
=
(
speed
>>
8
)
&
0xff
;
rq
.
cmd
[
3
]
=
speed
&
0xff
;
if
((
cdi
->
mask
&
(
CDC_CD_R
|
CDC_CD_RW
|
CDC_DVD_R
))
!=
(
CDC_CD_R
|
CDC_CD_RW
|
CDC_DVD_R
))
{
/* Write Drive speed in kbytes/second MSB/LSB */
rq
.
cmd
[
4
]
=
(
speed
>>
8
)
&
0xff
;
rq
.
cmd
[
5
]
=
speed
&
0xff
;
}
stat
=
cdrom_queue_packet_command
(
drive
,
&
rq
);
if
(
!
ide_cdrom_get_capabilities
(
drive
,
buf
))
{
ide_cdrom_update_speed
(
drive
,
buf
);
cdi
->
speed
=
cd
->
current_speed
;
}
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录