queue.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #define MMC_QUEUE_SUSPENDED (1 << 0)
  27. #define MMC_QUEUE_NEW_REQUEST (1 << 1)
  28. int (*issue_fn)(struct mmc_queue *, struct request *);
  29. void *data;
  30. struct request_queue *queue;
  31. struct mmc_queue_req mqrq[2];
  32. struct mmc_queue_req *mqrq_cur;
  33. struct mmc_queue_req *mqrq_prev;
  34. };
  35. extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
  36. const char *);
  37. extern void mmc_cleanup_queue(struct mmc_queue *);
  38. extern void mmc_queue_suspend(struct mmc_queue *);
  39. extern void mmc_queue_resume(struct mmc_queue *);
  40. extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
  41. struct mmc_queue_req *);
  42. extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
  43. extern void mmc_queue_bounce_post(struct mmc_queue_req *);
  44. #endif