Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
bf717b11
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
bf717b11
编写于
6月 13, 2006
作者:
J
Jeff Garzik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libata] Update docs to reflect current driver API
上级
f0eb62b8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
81 addition
and
25 deletion
+81
-25
Documentation/DocBook/libata.tmpl
Documentation/DocBook/libata.tmpl
+80
-24
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+1
-1
未找到文件。
Documentation/DocBook/libata.tmpl
浏览文件 @
bf717b11
...
@@ -169,6 +169,22 @@ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
...
@@ -169,6 +169,22 @@ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
</sect2>
</sect2>
<sect2><title>
PIO data read/write
</title>
<programlisting>
void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int);
</programlisting>
<para>
All bmdma-style drivers must implement this hook. This is the low-level
operation that actually copies the data bytes during a PIO data
transfer.
Typically the driver
will choose one of ata_pio_data_xfer_noirq(), ata_pio_data_xfer(), or
ata_mmio_data_xfer().
</para>
</sect2>
<sect2><title>
ATA command execute
</title>
<sect2><title>
ATA command execute
</title>
<programlisting>
<programlisting>
void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
...
@@ -204,11 +220,10 @@ command.
...
@@ -204,11 +220,10 @@ command.
<programlisting>
<programlisting>
u8 (*check_status)(struct ata_port *ap);
u8 (*check_status)(struct ata_port *ap);
u8 (*check_altstatus)(struct ata_port *ap);
u8 (*check_altstatus)(struct ata_port *ap);
u8 (*check_err)(struct ata_port *ap);
</programlisting>
</programlisting>
<para>
<para>
Reads the Status/AltStatus
/Error
ATA shadow register from
Reads the Status/AltStatus ATA shadow register from
hardware. On some hardware, reading the Status register has
hardware. On some hardware, reading the Status register has
the side effect of clearing the interrupt condition.
the side effect of clearing the interrupt condition.
Most drivers for taskfile-based hardware use
Most drivers for taskfile-based hardware use
...
@@ -269,23 +284,6 @@ void (*set_mode) (struct ata_port *ap);
...
@@ -269,23 +284,6 @@ void (*set_mode) (struct ata_port *ap);
</sect2>
</sect2>
<sect2><title>
Reset ATA bus
</title>
<programlisting>
void (*phy_reset) (struct ata_port *ap);
</programlisting>
<para>
The very first step in the probe phase. Actions vary depending
on the bus type, typically. After waking up the device and probing
for device presence (PATA and SATA), typically a soft reset
(SRST) will be performed. Drivers typically use the helper
functions ata_bus_reset() or sata_phy_reset() for this hook.
Many SATA drivers use sata_phy_reset() or call it from within
their own phy_reset() functions.
</para>
</sect2>
<sect2><title>
Control PCI IDE BMDMA engine
</title>
<sect2><title>
Control PCI IDE BMDMA engine
</title>
<programlisting>
<programlisting>
void (*bmdma_setup) (struct ata_queued_cmd *qc);
void (*bmdma_setup) (struct ata_queued_cmd *qc);
...
@@ -354,16 +352,74 @@ int (*qc_issue) (struct ata_queued_cmd *qc);
...
@@ -354,16 +352,74 @@ int (*qc_issue) (struct ata_queued_cmd *qc);
</sect2>
</sect2>
<sect2><title>
Timeout (error) handling
</title>
<sect2><title>
Exception and probe handling (EH)
</title>
<programlisting>
<programlisting>
void (*eng_timeout) (struct ata_port *ap);
void (*eng_timeout) (struct ata_port *ap);
void (*phy_reset) (struct ata_port *ap);
</programlisting>
<para>
Deprecated. Use ->error_handler() instead.
</para>
<programlisting>
void (*freeze) (struct ata_port *ap);
void (*thaw) (struct ata_port *ap);
</programlisting>
<para>
ata_port_freeze() is called when HSM violations or some other
condition disrupts normal operation of the port. A frozen port
is not allowed to perform any operation until the port is
thawed, which usually follows a successful reset.
</para>
<para>
The optional ->freeze() callback can be used for freezing the port
hardware-wise (e.g. mask interrupt and stop DMA engine). If a
port cannot be frozen hardware-wise, the interrupt handler
must ack and clear interrupts unconditionally while the port
is frozen.
</para>
<para>
The optional ->thaw() callback is called to perform the opposite of ->freeze():
prepare the port for normal operation once again. Unmask interrupts,
start DMA engine, etc.
</para>
<programlisting>
void (*error_handler) (struct ata_port *ap);
</programlisting>
<para>
->error_handler() is a driver's hook into probe, hotplug, and recovery
and other exceptional conditions. The primary responsibility of an
implementation is to call ata_do_eh() or ata_bmdma_drive_eh() with a set
of EH hooks as arguments:
</para>
<para>
'prereset' hook (may be NULL) is called during an EH reset, before any other actions
are taken.
</para>
<para>
'postreset' hook (may be NULL) is called after the EH reset is performed. Based on
existing conditions, severity of the problem, and hardware capabilities,
</para>
<para>
Either 'softreset' (may be NULL) or 'hardreset' (may be NULL) will be
called to perform the low-level EH reset.
</para>
<programlisting>
void (*post_internal_cmd) (struct ata_queued_cmd *qc);
</programlisting>
</programlisting>
<para>
<para>
This is a high level error handling function, called from the
Perform any hardware-specific actions necessary to finish processing
error handling thread, when a command times out. Most newer
after executing a probe-time or EH-time command via ata_exec_internal().
hardware will implement its own error handling code here. IDE BMDMA
drivers may use the helper function ata_eng_timeout().
</para>
</para>
</sect2>
</sect2>
...
...
drivers/scsi/libata-core.c
浏览文件 @
bf717b11
...
@@ -3496,7 +3496,7 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words)
...
@@ -3496,7 +3496,7 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words)
/**
/**
* ata_mmio_data_xfer - Transfer data by MMIO
* ata_mmio_data_xfer - Transfer data by MMIO
* @dev: device for this I/O
* @
a
dev: device for this I/O
* @buf: data buffer
* @buf: data buffer
* @buflen: buffer length
* @buflen: buffer length
* @write_data: read/write
* @write_data: read/write
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录