ioctl.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef LINUX_MMC_IOCTL_H
  2. #define LINUX_MMC_IOCTL_H
  3. struct mmc_ioc_cmd {
  4. /* Implies direction of data. true = write, false = read */
  5. int write_flag;
  6. /* Application-specific command. true = precede with CMD55 */
  7. int is_acmd;
  8. __u32 opcode;
  9. __u32 arg;
  10. __u32 response[4]; /* CMD response */
  11. unsigned int flags;
  12. unsigned int blksz;
  13. unsigned int blocks;
  14. /*
  15. * Sleep at least postsleep_min_us useconds, and at most
  16. * postsleep_max_us useconds *after* issuing command. Needed for
  17. * some read commands for which cards have no other way of indicating
  18. * they're ready for the next command (i.e. there is no equivalent of
  19. * a "busy" indicator for read operations).
  20. */
  21. unsigned int postsleep_min_us;
  22. unsigned int postsleep_max_us;
  23. /*
  24. * Override driver-computed timeouts. Note the difference in units!
  25. */
  26. unsigned int data_timeout_ns;
  27. unsigned int cmd_timeout_ms;
  28. /*
  29. * For 64-bit machines, the next member, ``__u64 data_ptr``, wants to
  30. * be 8-byte aligned. Make sure this struct is the same size when
  31. * built for 32-bit.
  32. */
  33. __u32 __pad;
  34. /* DAT buffer */
  35. __u64 data_ptr;
  36. };
  37. #define mmc_ioc_cmd_set_data(ic, ptr) ic.data_ptr = (__u64)(unsigned long) ptr
  38. #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)
  39. /*
  40. * Since this ioctl is only meant to enhance (and not replace) normal access
  41. * to the mmc bus device, an upper data transfer limit of MMC_IOC_MAX_BYTES
  42. * is enforced per ioctl call. For larger data transfers, use the normal
  43. * block device operations.
  44. */
  45. #define MMC_IOC_MAX_BYTES (512L * 256)
  46. #endif /* LINUX_MMC_IOCTL_H */