Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
53126b91
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
53126b91
编写于
2月 01, 2008
作者:
B
Bartlomiej Zolnierkiewicz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ide-cd: merge cdrom_read_subchannel() into ide_cdrom_get_mcn()
Signed-off-by:
N
Bartlomiej Zolnierkiewicz
<
bzolnier@gmail.com
>
上级
a891b144
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
21 addition
and
32 deletion
+21
-32
drivers/ide/ide-cd.c
drivers/ide/ide-cd.c
+21
-32
未找到文件。
drivers/ide/ide-cd.c
浏览文件 @
53126b91
...
...
@@ -2017,25 +2017,6 @@ static int ide_cd_read_tochdr(ide_drive_t *drive, void *arg)
return
0
;
}
static
int
cdrom_read_subchannel
(
ide_drive_t
*
drive
,
int
format
,
char
*
buf
,
int
buflen
,
struct
request_sense
*
sense
)
{
struct
request
req
;
cdrom_prepare_request
(
drive
,
&
req
);
req
.
sense
=
sense
;
req
.
data
=
buf
;
req
.
data_len
=
buflen
;
req
.
cmd
[
0
]
=
GPCMD_READ_SUBCHANNEL
;
req
.
cmd
[
1
]
=
2
;
/* MSF addressing */
req
.
cmd
[
2
]
=
0x40
;
/* request subQ data */
req
.
cmd
[
3
]
=
format
;
req
.
cmd
[
7
]
=
(
buflen
>>
8
);
req
.
cmd
[
8
]
=
(
buflen
&
0xff
);
return
cdrom_queue_packet_command
(
drive
,
&
req
);
}
/* 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
,
...
...
@@ -2377,28 +2358,36 @@ int ide_cdrom_get_last_session (struct cdrom_device_info *cdi,
return
0
;
}
static
int
ide_cdrom_get_mcn
(
struct
cdrom_device_info
*
cdi
,
static
int
ide_cdrom_get_mcn
(
struct
cdrom_device_info
*
cdi
,
struct
cdrom_mcn
*
mcn_info
)
{
int
stat
;
char
mcnbuf
[
24
];
ide_drive_t
*
drive
=
cdi
->
handle
;
int
stat
,
mcnlen
;
struct
request
rq
;
char
buf
[
24
];
cdrom_prepare_request
(
drive
,
&
rq
);
/* get MCN */
if
((
stat
=
cdrom_read_subchannel
(
drive
,
2
,
mcnbuf
,
sizeof
(
mcnbuf
),
NULL
)))
rq
.
data
=
buf
;
rq
.
data_len
=
sizeof
(
buf
);
rq
.
cmd
[
0
]
=
GPCMD_READ_SUBCHANNEL
;
rq
.
cmd
[
1
]
=
2
;
/* MSF addressing */
rq
.
cmd
[
2
]
=
0x40
;
/* request subQ data */
rq
.
cmd
[
3
]
=
2
;
/* format */
rq
.
cmd
[
8
]
=
sizeof
(
buf
);
stat
=
cdrom_queue_packet_command
(
drive
,
&
rq
);
if
(
stat
)
return
stat
;
memcpy
(
mcn_info
->
medium_catalog_number
,
mcnbuf
+
9
,
sizeof
(
mcn_info
->
medium_catalog_number
)
-
1
);
mcn_info
->
medium_catalog_number
[
sizeof
(
mcn_info
->
medium_catalog_number
)
-
1
]
=
'\0'
;
mcnlen
=
sizeof
(
mcn_info
->
medium_catalog_number
)
-
1
;
memcpy
(
mcn_info
->
medium_catalog_number
,
buf
+
9
,
mcnlen
);
mcn_info
->
medium_catalog_number
[
mcnlen
]
=
'\0'
;
return
0
;
}
/****************************************************************************
* Other driver requests (open, close, check media change).
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录