queue.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef MMC_QUEUE_H
  2. #define MMC_QUEUE_H
  3. struct request;
  4. struct task_struct;
  5. struct mmc_blk_request {
  6. struct mmc_request mrq;
  7. struct mmc_command sbc;
  8. struct mmc_command cmd;
  9. struct mmc_command stop;
  10. struct mmc_data data;
  11. };
  12. struct mmc_queue_req {
  13. struct request *req;
  14. struct mmc_blk_request brq;
  15. struct scatterlist *sg;
  16. char *bounce_buf;
  17. struct scatterlist *bounce_sg;
  18. unsigned int bounce_sg_len;
  19. struct mmc_async_req mmc_active;
  20. };
  21. struct mmc_queue {
  22. struct mmc_card *card;
  23. struct task_struct *thread;
  24. struct semaphore thread_sem;
  25. unsigned int flags;
  26. int (*issue_fn)(struct mmc_queue *, struct request *);
  27. void *data;
  28. struct request_queue *queue;
  29. struct mmc_queue_req mqrq[2];
  30. struct mmc_queue_req *mqrq_cur;
  31. struct mmc_queue_req *mqrq_prev;
  32. };
  33. extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
  34. const char *);
  35. extern void mmc_cleanup_queue(struct mmc_queue *);
  36. extern void mmc_queue_suspend(struct mmc_queue *);
  37. extern void mmc_queue_resume(struct mmc_queue *);
  38. extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
  39. struct mmc_queue_req *);
  40. extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
  41. extern void mmc_queue_bounce_post(struct mmc_queue_req *);
  42. #endif