Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
972dcafb
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,发现更多精彩内容 >>
提交
972dcafb
编写于
8月 11, 2005
作者:
D
Douglas Gilbert
提交者:
Jeff Garzik
8月 11, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libata scsi] add START STOP UNIT translation
上级
4c718122
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
58 addition
and
0 deletion
+58
-0
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+56
-0
include/linux/ata.h
include/linux/ata.h
+2
-0
未找到文件。
drivers/scsi/libata-scsi.c
浏览文件 @
972dcafb
...
@@ -391,6 +391,60 @@ int ata_scsi_error(struct Scsi_Host *host)
...
@@ -391,6 +391,60 @@ int ata_scsi_error(struct Scsi_Host *host)
return
0
;
return
0
;
}
}
/**
* ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command
* @qc: Storage for translated ATA taskfile
* @scsicmd: SCSI command to translate
*
* Sets up an ATA taskfile to issue STANDBY (to stop) or READ VERIFY
* (to start). Perhaps these commands should be preceded by
* CHECK POWER MODE to see what power mode the device is already in.
* [See SAT revision 5 at www.t10.org]
*
* LOCKING:
* spin_lock_irqsave(host_set lock)
*
* RETURNS:
* Zero on success, non-zero on error.
*/
static
unsigned
int
ata_scsi_start_stop_xlat
(
struct
ata_queued_cmd
*
qc
,
u8
*
scsicmd
)
{
struct
ata_taskfile
*
tf
=
&
qc
->
tf
;
tf
->
flags
|=
ATA_TFLAG_DEVICE
|
ATA_TFLAG_ISADDR
;
tf
->
protocol
=
ATA_PROT_NODATA
;
if
(
scsicmd
[
1
]
&
0x1
)
{
;
/* ignore IMMED bit, violates sat-r05 */
}
if
(
scsicmd
[
4
]
&
0x2
)
return
1
;
/* LOEJ bit set not supported */
if
(((
scsicmd
[
4
]
>>
4
)
&
0xf
)
!=
0
)
return
1
;
/* power conditions not supported */
if
(
scsicmd
[
4
]
&
0x1
)
{
tf
->
nsect
=
1
;
/* 1 sector, lba=0 */
tf
->
lbah
=
0x0
;
tf
->
lbam
=
0x0
;
tf
->
lbal
=
0x0
;
tf
->
device
|=
ATA_LBA
;
tf
->
command
=
ATA_CMD_VERIFY
;
/* READ VERIFY */
}
else
{
tf
->
nsect
=
0
;
/* time period value (0 implies now) */
tf
->
command
=
ATA_CMD_STANDBY
;
/* Consider: ATA STANDBY IMMEDIATE command */
}
/*
* Standby and Idle condition timers could be implemented but that
* would require libata to implement the Power condition mode page
* and allow the user to change it. Changing mode pages requires
* MODE SELECT to be implemented.
*/
return
0
;
}
/**
/**
* ata_scsi_flush_xlat - Translate SCSI SYNCHRONIZE CACHE command
* ata_scsi_flush_xlat - Translate SCSI SYNCHRONIZE CACHE command
* @qc: Storage for translated ATA taskfile
* @qc: Storage for translated ATA taskfile
...
@@ -1435,6 +1489,8 @@ static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)
...
@@ -1435,6 +1489,8 @@ static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)
case
VERIFY
:
case
VERIFY
:
case
VERIFY_16
:
case
VERIFY_16
:
return
ata_scsi_verify_xlat
;
return
ata_scsi_verify_xlat
;
case
START_STOP
:
return
ata_scsi_start_stop_xlat
;
}
}
return
NULL
;
return
NULL
;
...
...
include/linux/ata.h
浏览文件 @
972dcafb
...
@@ -108,6 +108,8 @@ enum {
...
@@ -108,6 +108,8 @@ enum {
/* ATA device commands */
/* ATA device commands */
ATA_CMD_CHK_POWER
=
0xE5
,
/* check power mode */
ATA_CMD_CHK_POWER
=
0xE5
,
/* check power mode */
ATA_CMD_STANDBY
=
0xE2
,
/* place in standby power mode */
ATA_CMD_IDLE
=
0xE3
,
/* place in idle power mode */
ATA_CMD_EDD
=
0x90
,
/* execute device diagnostic */
ATA_CMD_EDD
=
0x90
,
/* execute device diagnostic */
ATA_CMD_FLUSH
=
0xE7
,
ATA_CMD_FLUSH
=
0xE7
,
ATA_CMD_FLUSH_EXT
=
0xEA
,
ATA_CMD_FLUSH_EXT
=
0xEA
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录