免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1189 | 回复: 0
打印 上一主题 下一主题

libata reading notes - io operation part 2 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-25 10:08 |只看该作者 |倒序浏览
Part2 ahci driver level
Each AHCI controller implements several sata ports, each port connects
to one SATA device.
AHCI driver needs to setup the command table for each port and use the
command table to issue read/write command to AHCI controller.
In libata, each ata port is represented by an ata_port struct, AHCI
driver has ahci_port_priv as driver private part, it mainly stores the
dma address for the command table.
ahci_port_start:
    alloc memory used for dma (AHCI_PORT_PRIV_DMA_SZ bytes)
    power up the port
    start the port DMA engine

ahci_qc_prep:
    ata_queued_cmd has all the needed info, including
    ata_taskfile (read/write command, sector address)
    scatter-gather list used for DMA
    according to these info, ahci_qc_prep will setup the corresponding
    command slot entry and the command table
    1. convert taskfile to a command FIS
    2. fill the PRDT according to the sg list in ata_queued_cmd
    3. fill the command slot (point to the command table)
ahci_qc_issue:
    Once the command slot and command table have been setup, driver will
    setup the corresponding bit in PORT_CMD_ISSUE to tell the host
    controller there is new command coming.
    For NCQ command, driver needs to setup the corresponding bit in
    PORT_SCR_ACT. Driver needs to test this register to know the
    completion status of issued command, non-NCQ command should read
    PORT_CMD_ISSUE instead (see the interrupt service routine
    ahci_port_intr for details).
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/100604/showart_2130350.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP