zoukankan      html  css  js  c++  java
  • Linux mmc framework2:基本组件之queue

    1.前言

    本文主要介绍card下queue组件的主要流程,在介绍的过程中,将详细说明和queue相关的流程,涉及到其它组件的详细流程再在相关文章中说明。

    2.主要数据结构和API

    2.1 struct mmc_queue

    Elemete Name struct mmc_queue
    Path include/linux/mmc/queue.h
    Responsiblities

     mmc device的请求队列,用于处理mmc device请求

    Attributions
    • card:struct mmc_card *类型,此请求队列所对应的mmc device
    • thread:struct task_struct *类型,用于循环处理mmc queue中的request
    • thread_sem:struct semaphore类型,用于控制mmc queue的信号量
    • flags:MMC_QUEUE_SUSPENDED  or MMC_QUEUE_NEW_REQUEST 
    • issue_fn:request的处理函数
    • data:指向mmc_block_data
    • queue:struct request_queue *类型,与mmc_queue关联的request_queue
    • mqrq[2]:struct mmc_queue_req类型,存放当前的mmc request和prev request
    • mqrq_cur:struct mmc_queue_req *类型,代表当前的mmc request
    • mqrq_prev:struct mmc_queue_req *类型,代表前一个mmc request
    Operations
    •  int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock, const char *subname)

    初始化mmc request queue,创建请求队列,并启动线程对queue中的request进行处理

    • void mmc_cleanup_queue(struct mmc_queue *mq)

    停止处理request queue中的请求,并释放相关资源

    • void mmc_queue_suspend(struct mmc_queue *mq)

    挂起请求队列,但是会等待未处理完的请求处理完毕

    • void mmc_queue_resume(struct mmc_queue *mq)

    恢复之前挂起的请求队列 

    unsigned int mmc_queue_map_sg(struct mmc_queue *mq, struct mmc_queue_req *mqrq)

    2.2 struct mmc_queue_req

    Elemete Name struct mmc_queue_req
    Path include/linux/mmc/queue.h
    Responsiblities

     mmc device的请求

    Attributions
    • req:struct request *类型
    • brq:struct mmc_blk_request类型
    • sg:struct scatterlist *类型
    • bounce_buf:
    • bounce_sg:struct scatterlist *类型
    • bounce_sg_len:
    • mmc_active:struct mmc_async_req类型
    • cmd_type:enum mmc_packed_type类型
    • packed:struct mmc_packed *类型
    Operations

    TODO

  • 相关阅读:
    MySql 5.6以下版本自定义函数返回VARCHAR的中文问题
    解决Tomcat的java.lang.IllegalStateException: Cannot create a session after the response has been committed问题
    Lucene自定义规则范围查询
    JS吊炸天的代码
    又是正则
    JS显示指定字符数,避免一个中文两个字符的情况
    PostgreSql查看当前表的主外键关系
    java基础(个人学习笔记) A
    Elasticsearch5.5.1插件开发指南
    ElasticSearch5.5.1插件分类
  • 原文地址:https://www.cnblogs.com/smartjourneys/p/6728084.html
Copyright © 2011-2022 走看看